// UPDATED BY Kiran Pashikanti <kpatvt@gmail.com>
// All changes are distributed under same terms as the original XSteam code.
//
// * Changes are as follows:
// * Jan 14, 2021
// * This javascript version is based on a automated conversion of python to js using
// * the excellent JavaScripthon library found here https://github.com/metapensiero/metapensiero.pj
// * Only the Math/Number module from standard javascript is used, so this should run everywhere.
// * The conversions to bar and deg_C have been removed, all units are the same as the official specification
// * Equations added for metable vapor Region 2 but must be called directly
// * The coefficients for region 5 were updated to match most recent 2012 IAPWS 97 release
// * Iteration counters (max 1000 iterations) added to ensure no infinite loops when calling iterated properties
// * A self-test routine to check that calculated values match reference values in 2012 IAPWS 97 release (They do)
//
//
// ***********************************************************************************************************
// * Water and steam properties according to IAPWS IF-97                                                     *
// * By Magnus Holmgren, www.x-eng.com                                                                       *
// * The steam tables are free and provided as is.                                                           *
// * We take no responsibilities for any errors in the code or damage thereby.                               *
// * You are free to use, modify and distribute the code as long as authorship is properly acknowledged.     *
// * Please notify me at magnus@x-eng.com if the code is used in commercial applications                     *
// ***********************************************************************************************************
//
// XSteam provides accurate steam and water properties from 0 - 1000 bar and from 0 - 2000 deg C according to
// the standard IAPWS IF-97. For accuracy of the functions in different regions see IF-97 (www.iapws.org)
//
// *** Using XSteam *****************************************************************************************
// XSteam take 2 or 3 arguments. The first argument must always be the steam table function you want to use.
// The other arguments are the inputs to that function.
// Example: XSteam('h_pt',1,20)  Returns the enthalpy of water at 1 bar and 20 degC
// Example: XSteam('TSat_p',1)  Returns the saturation temperature of water at 1 bar.
// For a list of valid Steam Table functions se bellow or the XSteam macros for MS Excel.
//
// *** Nomenclature ******************************************************************************************
// First the wanted property then a _ then the wanted input properties.
// Example. T_ph is temperature as a function of pressure and enthalpy.
// For a list of valid functions se bellow or XSteam for MS Excel.
// T    Temperature (K)
// p	Pressure    (MPa)
// h	Enthalpy    (kJ/kg)
// v	Specific volume (m3/kg)
// rho	Density
// s	Specific entropy
// u	Specific internal energy
// Cp	Specific isobaric heat capacity
// Cv	Specific isochoric heat capacity
// w	Speed of sound
// my	Viscosity
// tc	Thermal Conductivity
// st	Surface Tension
// x	Vapour fraction
// vx	Vapour Volume Fraction
//
// *** Valid Steam table functions. ****************************************************************************
//
// Temperature
// Tsat_p	Saturation temperature
// T_ph  Temperature as a function of pressure and enthalpy
// T_ps  Temperature as a function of pressure and entropy
// T_hs  Temperature as a function of enthalpy and entropy
//
// Pressure
// psat_T Saturation pressure
// p_hs	 Pressure as a function of h and s.
// p_hrho Pressure as a function of h and rho. Very inaccurate for solid water region
//        since it's almost incompressible!
//
// Enthalpy
// hV_p	 Saturated vapour enthalpy
// hL_p	 Saturated liquid enthalpy
// hV_T	 Saturated vapour enthalpy
// hL_T	 Saturated liquid enthalpy
// h_pT	 Enthalpy as a function of pressure and temperature.
// h_ps	 Enthalpy as a function of pressure and entropy.
// h_px	 Enthalpy as a function of pressure and vapour fraction
// h_prho  Enthalpy as a function of pressure and density. Observe for low temperatures (liquid)
//           this equation has 2 solutions.
// h_Tx	 Enthalpy as a function of temperature and vapour fraction
//
// Specific volume
// vV_p	Saturated vapour volume
// vL_p	Saturated liquid volume
// vV_T	Saturated vapour volume
// vL_T	Saturated liquid volume
// v_pT	Specific volume as a function of pressure and temperature.
// v_ph	Specific volume as a function of pressure and enthalpy
// v_ps	Specific volume as a function of pressure and entropy.
//
// Density
// rhoV_p	Saturated vapour density
// rhoL_p	Saturated liquid density
// rhoV_T	Saturated vapour density
// rhoL_T	Saturated liquid density
// rho_pT	Density as a function of pressure and temperature.
// rho_ph	Density as a function of pressure and enthalpy
// rho_ps	Density as a function of pressure and entropy.
//
// Specific entropy
// sV_p	Saturated vapour entropy
// sL_p	Saturated liquid entropy
// sV_T	Saturated vapour entropy
// sL_T	Saturated liquid entropy
// s_pT	Specific entropy as a function of pressure and temperature (Returns saturated vapour Enthalpy if mixture.)
// s_ph	Specific entropy as a function of pressure and enthalpy
//
// Specific internal energy
// uV_p	Saturated vapour internal energy
// uL_p	Saturated liquid internal energy
// uV_T	Saturated vapour internal energy
// uL_T	Saturated liquid internal energy
// u_pT	Specific internal energy as a function of pressure and temperature.
// u_ph	Specific internal energy as a function of pressure and enthalpy
// u_ps	Specific internal energy as a function of pressure and entropy.
//
// Specific isobaric heat capacity
// CpV_p	Saturated vapour heat capacity
// CpL_p	Saturated liquid heat capacity
// CpV_T	Saturated vapour heat capacity
// CpL_T	Saturated liquid heat capacity
// Cp_pT	Specific isobaric heat capacity as a function of pressure and temperature.
// Cp_ph	Specific isobaric heat capacity as a function of pressure and enthalpy
// Cp_ps	Specific isobaric heat capacity as a function of pressure and entropy.
//
// Specific isochoric heat capacity
// CvV_p	Saturated vapour isochoric heat capacity
// CvL_p	Saturated liquid isochoric heat capacity
// CvV_T	Saturated vapour isochoric heat capacity
// CvL_T	Saturated liquid isochoric heat capacity
// Cv_pT	Specific isochoric heat capacity as a function of pressure and temperature.
// Cv_ph	Specific isochoric heat capacity as a function of pressure and enthalpy
// Cv_ps	Specific isochoric heat capacity as a function of pressure and entropy.
//
// Speed of sound
// wV_p	Saturated vapour speed of sound
// wL_p	Saturated liquid speed of sound
// wV_T	Saturated vapour speed of sound
// wL_T	Saturated liquid speed of sound
// w_pT	Speed of sound as a function of pressure and temperature.
// w_ph	Speed of sound as a function of pressure and enthalpy
// w_ps	Speed of sound as a function of pressure and entropy.
//
// Viscosity
// Viscosity is not part of IAPWS Steam IF97. Equations from
// "Revised Release on the IAPWS Formulation 1985 for the Viscosity of Ordinary Water Substance", 2003 are used.
// Viscosity in the mixed region (4) is interpolated according to the density. This is not true since it will
// be two phases
// my_pT	Viscosity as a function of pressure and temperature.
// my_ph	Viscosity as a function of pressure and enthalpy
// my_ps	Viscosity as a function of pressure and entropy.
//
// Thermal Conductivity
// Revised release on the IAPWS Formulation 1985 for the Thermal Conductivity of ordinary water substance (IAPWS 1998)
// tcL_p	Saturated vapour thermal conductivity
// tcV_p	Saturated liquid thermal conductivity
// tcL_T	Saturated vapour thermal conductivity
// tcV_T	Saturated liquid thermal conductivity
// tc_pT	Thermal conductivity as a function of pressure and temperature.
// tc_ph	Thermal conductivity as a function of pressure and enthalpy
// tc_hs	Thermal conductivity as a function of enthalpy and entropy
//
// Surface tension
// st_T	Surface tension for two phase water/steam as a function of T
// st_p	Surface tension for two phase water/steam as a function of T
// Vapour fraction
// x_ph	Vapour fraction as a function of pressure and enthalpy
// x_ps	Vapour fraction as a function of pressure and entropy.
//
// Vapour volume fraction
// vx_ph	Vapour volume fraction as a function of pressure and enthalpy
// vx_ps	Vapour volume fraction as a function of pressure and entropy.


'use strict';
let T1_ph_I1, T1_ph_J1, T1_ph_n1, T1_ps_I1, T1_ps_J1, T1_ps_n1, T2_ph_part1_Ii, T2_ph_part1_Ji, T2_ph_part1_ni,
	T2_ph_part2_Ii, T2_ph_part2_Ji, T2_ph_part2_ni, T2_ph_part3_Ii, T2_ph_part3_Ji, T2_ph_part3_ni, T2_ps_part1_Ii,
	T2_ps_part1_Ji, T2_ps_part1_ni, T2_ps_part2_Ii, T2_ps_part2_Ji, T2_ps_part2_ni, T2_ps_part3_Ii, T2_ps_part3_Ji,
	T2_ps_part3_ni, T3_ph_part1_Ii, T3_ph_part1_Ji, T3_ph_part1_ni, T3_ph_part2_Ii, T3_ph_part2_Ji, T3_ph_part2_ni,
	T3_ps_part1_Ii, T3_ps_part1_Ji, T3_ps_part1_ni, T3_ps_part2_Ii, T3_ps_part2_Ji, T3_ps_part2_ni, T4_hs_Ii, T4_hs_Ji,
	T4_hs_ni, TB23_hs_Ii, TB23_hs_Ji, TB23_hs_ni, h4_s_part1_Ii, h4_s_part1_Ji, h4_s_part1_ni, h4_s_part2_Ii,
	h4_s_part2_Ji, h4_s_part2_ni, h4_s_part3_Ii, h4_s_part3_Ji, h4_s_part3_ni, h4_s_part4_Ii, h4_s_part4_Ji,
	h4_s_part4_ni, hB13_s_Ii, hB13_s_Ji, hB13_s_ni, my_pT_h0, my_pT_h1, my_pT_h2, my_pT_h3, my_pT_h4, my_pT_h5,
	my_pT_h6, my_ph_h0, my_ph_h1, my_ph_h2, my_ph_h3, my_ph_h4, my_ph_h5, my_ph_h6, p1_hs_I1, p1_hs_J1, p1_hs_n1,
	p2_hs_part1_Ii, p2_hs_part1_Ji, p2_hs_part1_ni, p2_hs_part2_Ii, p2_hs_part2_Ji, p2_hs_part2_ni, p2_hs_part3_Ii,
	p2_hs_part3_Ji, p2_hs_part3_ni, p3_hs_part1_Ii, p3_hs_part1_Ji, p3_hs_part1_ni, p3_hs_part2_Ii, p3_hs_part2_Ji,
	p3_hs_part2_ni, p3sat_h_Ii, p3sat_h_Ji, p3sat_h_ni, p3sat_s_Ii, p3sat_s_Ji, p3sat_s_ni, reg1_I1, reg1_J1, reg1_n1,
	reg2_Ir, reg2_J0, reg2_Jr, reg2_meta_Ir, reg2_meta_J0, reg2_meta_Jr, reg2_meta_n0, reg2_meta_nr, reg2_n0, reg2_nr,
	reg3_Ii, reg3_Ji, reg3_ni, reg5_Iir, reg5_Ji0, reg5_Jir, reg5_ni0, reg5_nir, v3_ph_part1_Ii, v3_ph_part1_Ji,
	v3_ph_part1_ni, v3_ph_part2_Ii, v3_ph_part2_Ji, v3_ph_part2_ni, v3_ps_part1_Ii, v3_ps_part1_Ji, v3_ps_part1_ni,
	v3_ps_part2_Ii, v3_ps_part2_Ji, v3_ps_part2_ni;

reg1_I1 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 5.0, 8.0, 8.0, 21.0, 23.0, 29.0, 30.0, 31.0, 32.0];
reg1_J1 = [(- 2.0), (- 1.0), 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, (- 9.0), (- 7.0), (- 1.0), 0.0, 1.0, 3.0, (- 3.0), 0.0, 1.0, 3.0, 17.0, (- 4.0), 0.0, 6.0, (- 5.0), (- 2.0), 10.0, (- 8.0), (- 11.0), (- 6.0), (- 29.0), (- 31.0), (- 38.0), (- 39.0), (- 40.0), (- 41.0)];
reg1_n1 = [0.14632971213167, (- 0.84548187169114), (- 3.756360367204), 3.3855169168385, (- 0.95791963387872), 0.15772038513228, (- 0.016616417199501), 0.00081214629983568, 0.00028319080123804, (- 0.00060706301565874), (- 0.018990068218419), (- 0.032529748770505), (- 0.021841717175414), (- 5.283835796993e-05), (- 0.00047184321073267), (- 0.00030001780793026), 4.7661393906987e-05, (- 4.4141845330846e-06), (- 7.2694996297594e-16), (- 3.1679644845054e-05), (- 2.8270797985312e-06), (- 8.5205128120103e-10), (- 2.2425281908e-06), (- 6.5171222895601e-07), (- 1.4341729937924e-13), (- 4.0516996860117e-07), (- 1.2734301741641e-09), (- 1.7424871230634e-10), (- 6.8762131295531e-19), 1.4478307828521e-20, 2.6335781662795e-23, (- 1.1947622640071e-23), 1.8228094581404e-24, (- 9.3537087292458e-26)];
T1_ph_I1 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 5.0, 6.0];
T1_ph_J1 = [0.0, 1.0, 2.0, 6.0, 22.0, 32.0, 0.0, 1.0, 2.0, 3.0, 4.0, 10.0, 32.0, 10.0, 32.0, 10.0, 32.0, 32.0, 32.0, 32.0];
T1_ph_n1 = [(- 238.72489924521), 404.21188637945, 113.49746881718, (- 5.8457616048039), (- 0.0001528548241314), (- 1.0866707695377e-06), (- 13.391744872602), 43.211039183559, (- 54.010067170506), 30.535892203916, (- 6.5964749423638), 0.0093965400878363, 1.157364750534e-07, (- 2.5858641282073e-05), (- 4.0644363084799e-09), 6.6456186191635e-08, 8.0670734103027e-11, (- 9.3477771213947e-13), 5.8265442020601e-15, (- 1.5020185953503e-17)];
T1_ps_I1 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 4.0];
T1_ps_J1 = [0.0, 1.0, 2.0, 3.0, 11.0, 31.0, 0.0, 1.0, 2.0, 3.0, 12.0, 31.0, 0.0, 1.0, 2.0, 9.0, 31.0, 10.0, 32.0, 32.0];
T1_ps_n1 = [174.78268058307, 34.806930892873, 6.5292584978455, 0.33039981775489, (- 1.9281382923196e-07), (- 2.4909197244573e-23), (- 0.26107636489332), 0.22592965981586, (- 0.064256463395226), 0.0078876289270526, 3.5672110607366e-10, 1.7332496994895e-24, 0.00056608900654837, (- 0.00032635483139717), 4.4778286690632e-05, (- 5.1322156908507e-10), (- 4.2522657042207e-26), 2.6400441360689e-13, 7.8124600459723e-29, (- 3.0732199903668e-31)];
p1_hs_I1 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 4.0, 4.0, 5.0];
p1_hs_J1 = [0.0, 1.0, 2.0, 4.0, 5.0, 6.0, 8.0, 14.0, 0.0, 1.0, 4.0, 6.0, 0.0, 1.0, 10.0, 4.0, 1.0, 4.0, 0.0];
p1_hs_n1 = [(- 0.691997014660582), (- 18.361254878756), (- 9.28332409297335), 65.9639569909906, (- 16.2060388912024), 450.620017338667, 854.68067822417, 6075.23214001162, 32.6487682621856, (- 26.9408844582931), (- 319.9478483343), (- 928.35430704332), 30.3634537455249, (- 65.0540422444146), (- 4309.9131651613), (- 747.512324096068), 730.000345529245, 1142.84032569021, (- 436.407041874559)];
reg2_J0 = [0.0, 1.0, (- 5.0), (- 4.0), (- 3.0), (- 2.0), (- 1.0), 2.0, 3.0];
reg2_n0 = [(- 9.6927686500217), 10.086655968018, (- 0.005608791128302), 0.071452738081455, (- 0.40710498223928), 1.4240819171444, (- 4.383951131945), (- 0.28408632460772), 0.021268463753307];
reg2_Ir = [1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 6.0, 6.0, 7.0, 7.0, 7.0, 8.0, 8.0, 9.0, 10.0, 10.0, 10.0, 16.0, 16.0, 18.0, 20.0, 20.0, 20.0, 21.0, 22.0, 23.0, 24.0, 24.0, 24.0];
reg2_Jr = [0.0, 1.0, 2.0, 3.0, 6.0, 1.0, 2.0, 4.0, 7.0, 36.0, 0.0, 1.0, 3.0, 6.0, 35.0, 1.0, 2.0, 3.0, 7.0, 3.0, 16.0, 35.0, 0.0, 11.0, 25.0, 8.0, 36.0, 13.0, 4.0, 10.0, 14.0, 29.0, 50.0, 57.0, 20.0, 35.0, 48.0, 21.0, 53.0, 39.0, 26.0, 40.0, 58.0];
reg2_nr = [(- 0.0017731742473213), (- 0.017834862292358), (- 0.045996013696365), (- 0.057581259083432), (- 0.05032527872793), (- 3.3032641670203e-05), (- 0.00018948987516315), (- 0.0039392777243355), (- 0.043797295650573), (- 2.6674547914087e-05), 2.0481737692309e-08, 4.3870667284435e-07, (- 3.227767723857e-05), (- 0.0015033924542148), (- 0.040668253562649), (- 7.8847309559367e-10), 1.2790717852285e-08, 4.8225372718507e-07, 2.2922076337661e-06, (- 1.6714766451061e-11), (- 0.0021171472321355), (- 23.895741934104), (- 5.905956432427e-18), (- 1.2621808899101e-06), (- 0.038946842435739), 1.1256211360459e-11, (- 8.2311340897998), 1.9809712802088e-08, 1.0406965210174e-19, (- 1.0234747095929e-13), (- 1.0018179379511e-09), (- 8.0882908646985e-11), 0.10693031879409, (- 0.33662250574171), 8.9185845355421e-25, 3.0629316876232e-13, (- 4.2002467698208e-06), (- 5.9056029685639e-26), 3.7826947613457e-06, (- 1.2768608934681e-15), 7.3087610595061e-29, 5.5414715350778e-17, (- 9.436970724121e-07)];
T2_ph_part1_Ji = [0.0, 1.0, 2.0, 3.0, 7.0, 20.0, 0.0, 1.0, 2.0, 3.0, 7.0, 9.0, 11.0, 18.0, 44.0, 0.0, 2.0, 7.0, 36.0, 38.0, 40.0, 42.0, 44.0, 24.0, 44.0, 12.0, 32.0, 44.0, 32.0, 36.0, 42.0, 34.0, 44.0, 28.0];
T2_ph_part1_Ii = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 4.0, 5.0, 5.0, 5.0, 6.0, 6.0, 7.0];
T2_ph_part1_ni = [1089.8952318288, 849.51654495535, (- 107.81748091826), 33.153654801263, (- 7.4232016790248), 11.765048724356, 1.844574935579, (- 4.1792700549624), 6.2478196935812, (- 17.344563108114), (- 200.58176862096), 271.96065473796, (- 455.11318285818), 3091.9688604755, 252266.40357872, (- 0.0061707422868339), (- 0.31078046629583), 11.670873077107, 128127984.04046, (- 985549096.23276), 2822454697.3002, (- 3594897141.0703), 1722734991.3197, (- 13551.334240775), 12848734.66465, 1.3865724283226, 235988.32556514, (- 13105236.545054), 7399.9835474766, (- 551966.9703006), 3715408.5996233, 19127.72923966, (- 415351.64835634), (- 62.459855192507)];
T2_ph_part2_Ji = [0.0, 1.0, 2.0, 12.0, 18.0, 24.0, 28.0, 40.0, 0.0, 2.0, 6.0, 12.0, 18.0, 24.0, 28.0, 40.0, 2.0, 8.0, 18.0, 40.0, 1.0, 2.0, 12.0, 24.0, 2.0, 12.0, 18.0, 24.0, 28.0, 40.0, 18.0, 24.0, 40.0, 28.0, 2.0, 28.0, 1.0, 40.0];
T2_ph_part2_Ii = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 5.0, 6.0, 7.0, 7.0, 9.0, 9.0];
T2_ph_part2_ni = [1489.5041079516, 743.07798314034, (- 97.708318797837), 2.4742464705674, (- 0.63281320016026), 1.1385952129658, (- 0.47811863648625), 0.0085208123431544, 0.93747147377932, 3.3593118604916, 3.3809355601454, 0.16844539671904, 0.73875745236695, (- 0.47128737436186), 0.15020273139707, (- 0.002176411421975), (- 0.021810755324761), (- 0.10829784403677), (- 0.046333324635812), 7.1280351959551e-05, 0.00011032831789999, 0.00018955248387902, 0.0030891541160537, 0.0013555504554949, 2.8640237477456e-07, (- 1.0779857357512e-05), (- 7.6462712454814e-05), 1.4052392818316e-05, (- 3.1083814331434e-05), (- 1.0302738212103e-06), 2.821728163504e-07, 1.2704902271945e-06, 7.3803353468292e-08, (- 1.1030139238909e-08), (- 8.1456365207833e-14), (- 2.5180545682962e-11), (- 1.7565233969407e-18), 8.6934156344163e-15];
T2_ph_part3_Ji = [0.0, 4.0, 0.0, 2.0, 0.0, 2.0, 0.0, 1.0, 0.0, 2.0, 0.0, 1.0, 4.0, 8.0, 4.0, 0.0, 1.0, 4.0, 10.0, 12.0, 16.0, 20.0, 22.0];
T2_ph_part3_Ii = [(- 7.0), (- 7.0), (- 6.0), (- 6.0), (- 5.0), (- 5.0), (- 2.0), (- 2.0), (- 1.0), (- 1.0), 0.0, 0.0, 1.0, 1.0, 2.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0];
T2_ph_part3_ni = [(- 3236839855524.2), 7326335090218.1, 358250899454.47, (- 583401318515.9), (- 10783068217.47), 20825544563.171, 610747.83564516, 859777.2253558, (- 25745.72360417), 31081.088422714, 1208.2315865936, 482.19755109255, 3.7966001272486, (- 10.842984880077), (- 0.04536417267666), 1.4559115658698e-13, 1.126159740723e-12, (- 1.7804982240686e-11), 1.2324579690832e-07, (- 1.1606921130984e-06), 2.7846367088554e-05, (- 0.00059270038474176), 0.0012918582991878];
T2_ps_part1_Ii = [(- 1.5), (- 1.5), (- 1.5), (- 1.5), (- 1.5), (- 1.5), (- 1.25), (- 1.25), (- 1.25), (- 1), (- 1), (- 1), (- 1), (- 1), (- 1), (- 0.75), (- 0.75), (- 0.5), (- 0.5), (- 0.5), (- 0.5), (- 0.25), (- 0.25), (- 0.25), (- 0.25), 0.25, 0.25, 0.25, 0.25, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.75, 0.75, 0.75, 0.75, 1, 1, 1.25, 1.25, 1.5, 1.5];
T2_ps_part1_Ji = [(- 24.0), (- 23.0), (- 19.0), (- 13.0), (- 11.0), (- 10.0), (- 19.0), (- 15.0), (- 6.0), (- 26.0), (- 21.0), (- 17.0), (- 16.0), (- 9.0), (- 8.0), (- 15.0), (- 14.0), (- 26.0), (- 13.0), (- 9.0), (- 7.0), (- 27.0), (- 25.0), (- 11.0), (- 6.0), 1.0, 4.0, 8.0, 11.0, 0.0, 1.0, 5.0, 6.0, 10.0, 14.0, 16.0, 0.0, 4.0, 9.0, 17.0, 7.0, 18.0, 3.0, 15.0, 5.0, 18.0];
T2_ps_part1_ni = [(- 392359.83861984), 515265.7382727, 40482.443161048, (- 321.93790923902), 96.961424218694, (- 22.867846371773), (- 449429.14124357), (- 5011.8336020166), 0.35684463560015, 44235.33584819, (- 13673.388811708), 421632.60207864, 22516.925837475, 474.42144865646, (- 149.31130797647), (- 197811.26320452), (- 23554.39947076), (- 19070.616302076), 55375.669883164, 3829.3691437363, (- 603.91860580567), 1936.3102620331, 4266.064369861, (- 5978.0638872718), (- 704.01463926862), 338.36784107553, 20.862786635187, 0.033834172656196, (- 4.3124428414893e-05), 166.53791356412, (- 139.86292055898), (- 0.78849547999872), 0.072132411753872, (- 0.0059754839398283), (- 1.2141358953904e-05), 2.3227096733871e-07, (- 10.538463566194), 2.0718925496502, (- 0.072193155260427), 2.074988708112e-07, (- 0.018340657911379), 2.9036272348696e-07, 0.21037527893619, 0.00025681239729999, (- 0.012799002933781), (- 8.2198102652018e-06)];
T2_ps_part2_Ii = [(- 6.0), (- 6.0), (- 5.0), (- 5.0), (- 4.0), (- 4.0), (- 4.0), (- 3.0), (- 3.0), (- 3.0), (- 3.0), (- 2.0), (- 2.0), (- 2.0), (- 2.0), (- 1.0), (- 1.0), (- 1.0), (- 1.0), (- 1.0), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 5.0];
T2_ps_part2_Ji = [0.0, 11.0, 0.0, 11.0, 0.0, 1.0, 11.0, 0.0, 1.0, 11.0, 12.0, 0.0, 1.0, 6.0, 10.0, 0.0, 1.0, 5.0, 8.0, 9.0, 0.0, 1.0, 2.0, 4.0, 5.0, 6.0, 9.0, 0.0, 1.0, 2.0, 3.0, 7.0, 8.0, 0.0, 1.0, 5.0, 0.0, 1.0, 3.0, 0.0, 1.0, 0.0, 1.0, 2.0];
T2_ps_part2_ni = [316876.65083497, 20.864175881858, (- 398593.99803599), (- 21.816058518877), 223697.85194242, (- 2784.1703445817), 9.920743607148, (- 75197.512299157), 2970.8605951158, (- 3.4406878548526), 0.38815564249115, 17511.29508575, (- 1423.7112854449), 1.0943803364167, 0.89971619308495, (- 3375.9740098958), 471.62885818355, (- 1.9188241993679), 0.41078580492196, (- 0.33465378172097), 1387.0034777505, (- 406.63326195838), 41.72734715961, 2.1932549434532, (- 1.0320050009077), 0.35882943516703, 0.0052511453726066, 12.838916450705, (- 2.8642437219381), 0.56912683664855, (- 0.099962954584931), (- 0.0032632037778459), 0.00023320922576723, (- 0.1533480985745), 0.029072288239902, 0.00037534702741167, 0.0017296691702411, (- 0.00038556050844504), (- 3.5017712292608e-05), (- 1.4566393631492e-05), 5.6420857267269e-06, 4.1286150074605e-08, (- 2.0684671118824e-08), 1.6409393674725e-09];
T2_ps_part3_Ii = [(- 2.0), (- 2.0), (- 1.0), 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 5.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 7.0, 7.0, 7.0];
T2_ps_part3_Ji = [0.0, 1.0, 0.0, 0.0, 1.0, 2.0, 3.0, 0.0, 1.0, 3.0, 4.0, 0.0, 1.0, 2.0, 0.0, 1.0, 5.0, 0.0, 1.0, 4.0, 0.0, 1.0, 2.0, 0.0, 1.0, 0.0, 1.0, 3.0, 4.0, 5.0];
T2_ps_part3_ni = [909.68501005365, 2404.566708842, (- 591.6232638713), 541.45404128074, (- 270.98308411192), 979.76525097926, (- 469.66772959435), 14.399274604723, (- 19.104204230429), 5.3299167111971, (- 21.252975375934), (- 0.3114733441376), 0.60334840894623, (- 0.042764839702509), 0.0058185597255259, (- 0.014597008284753), 0.0056631175631027, (- 7.6155864584577e-05), 0.00022440342919332, (- 1.2561095013413e-05), 6.3323132660934e-07, (- 2.0541989675375e-06), 3.6405370390082e-08, (- 2.9759897789215e-09), 1.0136618529763e-08, 5.9925719692351e-12, (- 2.0677870105164e-11), (- 2.0874278181886e-11), 1.0162166825089e-10, (- 1.6429828281347e-10)];
p2_hs_part1_Ii = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 3.0, 4.0, 5.0, 5.0, 6.0, 7.0];
p2_hs_part1_Ji = [1.0, 3.0, 6.0, 16.0, 20.0, 22.0, 0.0, 1.0, 2.0, 3.0, 5.0, 6.0, 10.0, 16.0, 20.0, 22.0, 3.0, 16.0, 20.0, 0.0, 2.0, 3.0, 6.0, 16.0, 16.0, 3.0, 16.0, 3.0, 1.0];
p2_hs_part1_ni = [(- 0.0182575361923032), (- 0.125229548799536), 0.592290437320145, 6.04769706185122, 238.624965444474, (- 298.639090222922), 0.051225081304075, (- 0.437266515606486), 0.413336902999504, (- 5.16468254574773), (- 5.57014838445711), 12.8555037824478, 11.414410895329, (- 119.504225652714), (- 2847.7798596156), 4317.57846408006, 1.1289404080265, 1974.09186206319, 1516.12444706087, 0.0141324451421235, 0.585501282219601, (- 2.97258075863012), 5.94567314847319, (- 6236.56565798905), 9659.86235133332, 6.81500934948134, (- 6332.07286824489), (- 5.5891922446576), 0.0400645798472063];
p2_hs_part2_Ii = [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0, 8.0, 8.0, 12.0, 14.0];
p2_hs_part2_Ji = [0.0, 1.0, 2.0, 4.0, 8.0, 0.0, 1.0, 2.0, 3.0, 5.0, 12.0, 1.0, 6.0, 18.0, 0.0, 1.0, 7.0, 12.0, 1.0, 16.0, 1.0, 12.0, 1.0, 8.0, 18.0, 1.0, 16.0, 1.0, 3.0, 14.0, 18.0, 10.0, 16.0];
p2_hs_part2_ni = [0.0801496989929495, (- 0.543862807146111), 0.337455597421283, 8.9055545115745, 313.840736431485, 0.797367065977789, (- 1.2161697355624), 8.72803386937477, (- 16.9769781757602), (- 186.552827328416), 95115.9274344237, (- 18.9168510120494), (- 4334.0703719484), 543212633.012715, 0.144793408386013, 128.024559637516, (- 67230.9534071268), 33697238.0095287, (- 586.63419676272), (- 22140322476.9889), 1716.06668708389, (- 570817595.806302), (- 3121.09693178482), (- 2078413.8463301), 3056059461577.86, 3221.57004314333, 326810259797.295, (- 1441.04158934487), 410.694867802691, 109077066873.024, (- 24796465425889.3), 1888019068.65134, (- 123651009018773)];
p2_hs_part3_Ii = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 3.0, 4.0, 5.0, 5.0, 5.0, 5.0, 6.0, 6.0, 10.0, 12.0, 16.0];
p2_hs_part3_Ji = [0.0, 1.0, 2.0, 3.0, 4.0, 8.0, 0.0, 2.0, 5.0, 8.0, 14.0, 2.0, 3.0, 7.0, 10.0, 18.0, 0.0, 5.0, 8.0, 16.0, 18.0, 18.0, 1.0, 4.0, 6.0, 14.0, 8.0, 18.0, 7.0, 7.0, 10.0];
p2_hs_part3_ni = [0.112225607199012, (- 3.39005953606712), (- 32.0503911730094), (- 197.5973051049), (- 407.693861553446), 13294.3775222331, 1.70846839774007, 37.3694198142245, 3581.44365815434, 423014.446424664, (- 751071025.760063), 52.3446127607898, (- 228.351290812417), (- 960652.417056937), (- 80705929.2526074), 1626980172256.69, 0.772465073604171, 46392.9973837746, (- 13731788.5134128), 1704703926305.12, (- 25110462818730.8), 31774883083552, 53.8685623675312, (- 55308.9094625169), (- 1028615.22421405), 2042494187562.34, 273918446.626977, (- 2639631463126850.0), (- 1078908541.08088), (- 29649262098.0124), (- 1117549073234240.0)];
reg2_meta_J0 = [0.0, 1.0, (- 5.0), (- 4.0), (- 3.0), (- 2.0), (- 1.0), 2.0, 3.0];
reg2_meta_n0 = [(- 9.6937268393049), 10.087275970006, (- 0.005608791128302), 0.071452738081455, (- 0.40710498223928), 1.4240819171444, (- 4.383951131945), (- 0.28408632460772), 0.021268463753307];
reg2_meta_Ir = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0];
reg2_meta_Jr = [0.0, 2.0, 5.0, 11.0, 1.0, 7.0, 16.0, 4.0, 16.0, 7.0, 10.0, 9.0, 10.0];
reg2_meta_nr = [(- 0.0073362260186506), (- 0.088223831943146), (- 0.072334555213245), (- 0.0040813178534455), 0.0020097803380207, (- 0.053045921898642), (- 0.007619040908697), (- 0.0063498037657313), (- 0.086043093028588), 0.007532158152277, (- 0.0079238375446139), (- 0.00022888160778447), (- 0.002645650148281)];
reg3_Ii = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 5.0, 6.0, 6.0, 6.0, 7.0, 8.0, 9.0, 9.0, 10.0, 10.0, 11.0];
reg3_Ji = [0.0, 0.0, 1.0, 2.0, 7.0, 10.0, 12.0, 23.0, 2.0, 6.0, 15.0, 17.0, 0.0, 2.0, 6.0, 7.0, 22.0, 26.0, 0.0, 2.0, 4.0, 16.0, 26.0, 0.0, 2.0, 4.0, 26.0, 1.0, 3.0, 26.0, 0.0, 2.0, 26.0, 2.0, 26.0, 2.0, 26.0, 0.0, 1.0, 26.0];
reg3_ni = [1.0658070028513, (- 15.732845290239), 20.944396974307, (- 7.6867707878716), 2.6185947787954, (- 2.808078114862), 1.2053369696517, (- 0.0084566812812502), (- 1.2654315477714), (- 1.1524407806681), 0.88521043984318, (- 0.64207765181607), 0.38493460186671, (- 0.85214708824206), 4.8972281541877, (- 3.0502617256965), 0.039420536879154, 0.12558408424308, (- 0.2799932969871), 1.389979956946, (- 2.018991502357), (- 0.0082147637173963), (- 0.47596035734923), 0.0439840744735, (- 0.44476435428739), 0.90572070719733, 0.70522450087967, 0.10770512626332, (- 0.32913623258954), (- 0.50871062041158), (- 0.022175400873096), 0.094260751665092, 0.16436278447961, (- 0.013503372241348), (- 0.014834345352472), 0.00057922953628084, 0.0032308904703711, 8.0964802996215e-05, (- 0.00016557679795037), (- 4.4923899061815e-05)];
T3_ph_part1_Ii = [(- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 10.0), (- 10.0), (- 10.0), (- 8.0), (- 8.0), (- 8.0), (- 8.0), (- 5.0), (- 3.0), (- 2.0), (- 2.0), (- 2.0), (- 1.0), (- 1.0), 0.0, 0.0, 1.0, 3.0, 3.0, 4.0, 4.0, 10.0, 12.0];
T3_ph_part1_Ji = [0.0, 1.0, 2.0, 6.0, 14.0, 16.0, 20.0, 22.0, 1.0, 5.0, 12.0, 0.0, 2.0, 4.0, 10.0, 2.0, 0.0, 1.0, 3.0, 4.0, 0.0, 2.0, 0.0, 1.0, 1.0, 0.0, 1.0, 0.0, 3.0, 4.0, 5.0];
T3_ph_part1_ni = [(- 1.33645667811215e-07), 4.55912656802978e-06, (- 1.46294640700979e-05), 0.0063934131297008, 372.783927268847, (- 7186.54377460447), 573494.7521034, (- 2675693.29111439), (- 3.34066283302614e-05), (- 0.0245479214069597), 47.8087847764996, 7.64664131818904e-06, 0.00128350627676972, 0.0171219081377331, (- 8.51007304583213), (- 0.0136513461629781), (- 3.84460997596657e-06), 0.00337423807911655, (- 0.551624873066791), 0.72920227710747, (- 0.00992522757376041), (- 0.119308831407288), 0.793929190615421, 0.454270731799386, 0.20999859125991, (- 0.00642109823904738), (- 0.023515586860454), 0.00252233108341612, (- 0.00764885133368119), 0.0136176427574291, (- 0.0133027883575669)];
T3_ph_part2_Ii = [(- 12.0), (- 12.0), (- 10.0), (- 10.0), (- 10.0), (- 10.0), (- 10.0), (- 8.0), (- 8.0), (- 8.0), (- 8.0), (- 8.0), (- 6.0), (- 6.0), (- 6.0), (- 4.0), (- 4.0), (- 3.0), (- 2.0), (- 2.0), (- 1.0), (- 1.0), (- 1.0), (- 1.0), (- 1.0), (- 1.0), 0.0, 0.0, 1.0, 3.0, 5.0, 6.0, 8.0];
T3_ph_part2_Ji = [0.0, 1.0, 0.0, 1.0, 5.0, 10.0, 12.0, 0.0, 1.0, 2.0, 4.0, 10.0, 0.0, 1.0, 2.0, 0.0, 1.0, 5.0, 0.0, 4.0, 2.0, 4.0, 6.0, 10.0, 14.0, 16.0, 0.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0];
T3_ph_part2_ni = [3.2325457364492e-05, (- 0.000127575556587181), (- 0.000475851877356068), 0.00156183014181602, 0.105724860113781, (- 85.8514221132534), 724.140095480911, 0.00296475810273257, (- 0.00592721983365988), (- 0.0126305422818666), (- 0.115716196364853), 84.9000969739595, (- 0.0108602260086615), 0.0154304475328851, 0.0750455441524466, 0.0252520973612982, (- 0.0602507901232996), (- 3.07622221350501), (- 0.0574011959864879), 5.03471360939849, (- 0.925081888584834), 3.91733882917546, (- 77.314600713019), 9493.08762098587, (- 1410437.19679409), 8491662.30819026, 0.861095729446704, 0.32334644281172, 0.873281936020439, (- 0.436653048526683), 0.286596714529479, (- 0.131778331276228), 0.00676682064330275];
v3_ph_part1_Ii = [(- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 10.0), (- 10.0), (- 10.0), (- 8.0), (- 8.0), (- 6.0), (- 6.0), (- 6.0), (- 4.0), (- 4.0), (- 3.0), (- 2.0), (- 2.0), (- 1.0), (- 1.0), (- 1.0), (- 1.0), 0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 3.0, 4.0, 5.0, 8.0];
v3_ph_part1_Ji = [6.0, 8.0, 12.0, 18.0, 4.0, 7.0, 10.0, 5.0, 12.0, 3.0, 4.0, 22.0, 2.0, 3.0, 7.0, 3.0, 16.0, 0.0, 1.0, 2.0, 3.0, 0.0, 1.0, 0.0, 1.0, 2.0, 0.0, 2.0, 0.0, 2.0, 2.0, 2.0];
v3_ph_part1_ni = [0.00529944062966028, (- 0.170099690234461), 11.1323814312927, (- 2178.98123145125), (- 0.000506061827980875), 0.556495239685324, (- 9.43672726094016), (- 0.297856807561527), 93.9353943717186, 0.0192944939465981, 0.421740664704763, (- 3689141.2628233), (- 0.00737566847600639), (- 0.354753242424366), (- 1.99768169338727), 1.15456297059049, 5683.6687581596, 0.00808169540124668, 0.172416341519307, 1.04270175292927, (- 0.297691372792847), 0.560394465163593, 0.275234661176914, (- 0.148347894866012), (- 0.0651142513478515), (- 2.92468715386302), 0.0664876096952665, 3.52335014263844, (- 0.0146340792313332), (- 2.24503486668184), 1.10533464706142, (- 0.0408757344495612)];
v3_ph_part2_Ii = [(- 12.0), (- 12.0), (- 8.0), (- 8.0), (- 8.0), (- 8.0), (- 8.0), (- 8.0), (- 6.0), (- 6.0), (- 6.0), (- 6.0), (- 6.0), (- 6.0), (- 4.0), (- 4.0), (- 4.0), (- 3.0), (- 3.0), (- 2.0), (- 2.0), (- 1.0), (- 1.0), (- 1.0), (- 1.0), 0.0, 1.0, 1.0, 2.0, 2.0];
v3_ph_part2_Ji = [0.0, 1.0, 0.0, 1.0, 3.0, 6.0, 7.0, 8.0, 0.0, 1.0, 2.0, 5.0, 6.0, 10.0, 3.0, 6.0, 10.0, 0.0, 2.0, 1.0, 2.0, 0.0, 1.0, 4.0, 5.0, 0.0, 0.0, 1.0, 2.0, 6.0];
v3_ph_part2_ni = [(- 2.25196934336318e-09), 1.40674363313486e-08, 2.3378408528056e-06, (- 3.31833715229001e-05), 0.00107956778514318, (- 0.271382067378863), 1.07202262490333, (- 0.853821329075382), (- 2.15214194340526e-05), 0.00076965608822273, (- 0.00431136580433864), 0.453342167309331, (- 0.507749535873652), (- 100.475154528389), (- 0.219201924648793), (- 3.21087965668917), 607.567815637771, 0.000557686450685932, 0.18749904002955, 0.00905368030448107, 0.285417173048685, 0.0329924030996098, 0.239897419685483, 4.82754995951394, (- 11.8035753702231), 0.169490044091791, (- 0.0179967222507787), 0.0371810116332674, (- 0.0536288335065096), 1.6069710109252];
T3_ps_part1_Ii = [(- 12.0), (- 12.0), (- 10.0), (- 10.0), (- 10.0), (- 10.0), (- 8.0), (- 8.0), (- 8.0), (- 8.0), (- 6.0), (- 6.0), (- 6.0), (- 5.0), (- 5.0), (- 5.0), (- 4.0), (- 4.0), (- 4.0), (- 2.0), (- 2.0), (- 1.0), (- 1.0), 0.0, 0.0, 0.0, 1.0, 2.0, 2.0, 3.0, 8.0, 8.0, 10.0];
T3_ps_part1_Ji = [28.0, 32.0, 4.0, 10.0, 12.0, 14.0, 5.0, 7.0, 8.0, 28.0, 2.0, 6.0, 32.0, 0.0, 14.0, 32.0, 6.0, 10.0, 36.0, 1.0, 4.0, 1.0, 6.0, 0.0, 1.0, 4.0, 0.0, 0.0, 3.0, 2.0, 0.0, 1.0, 2.0];
T3_ps_part1_ni = [1500420082.63875, (- 159397258480.424), 0.000502181140217975, (- 67.2057767855466), 1450.58545404456, (- 8238.8953488889), (- 0.154852214233853), 11.2305046746695, (- 29.7000213482822), 43856513263.5495, 0.00137837838635464, (- 2.97478527157462), 9717779473494.13, (- 5.71527767052398e-05), 28830.794977842, (- 74442828926270.3), 12.8017324848921, (- 368.275545889071), 6647689047791770.0, 0.044935925195888, (- 4.22897836099655), (- 0.240614376434179), (- 4.74341365254924), 0.72409399912611, 0.923874349695897, 3.99043655281015, 0.0384066651868009, (- 0.00359344365571848), (- 0.735196448821653), 0.188367048396131, 0.000141064266818704, (- 0.00257418501496337), 0.00123220024851555];
T3_ps_part2_Ii = [(- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 8.0), (- 8.0), (- 8.0), (- 6.0), (- 6.0), (- 6.0), (- 5.0), (- 5.0), (- 5.0), (- 5.0), (- 5.0), (- 4.0), (- 3.0), (- 3.0), (- 2.0), 0.0, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 12.0, 14.0];
T3_ps_part2_Ji = [1.0, 3.0, 4.0, 7.0, 0.0, 1.0, 3.0, 0.0, 2.0, 4.0, 0.0, 1.0, 2.0, 4.0, 6.0, 12.0, 1.0, 6.0, 2.0, 0.0, 1.0, 1.0, 0.0, 24.0, 0.0, 3.0, 1.0, 2.0];
T3_ps_part2_ni = [0.52711170160166, (- 40.1317830052742), 153.020073134484, (- 2247.99398218827), (- 0.193993484669048), (- 1.40467557893768), 42.6799878114024, 0.752810643416743, 22.6657238616417, (- 622.873556909932), (- 0.660823667935396), 0.841267087271658, (- 25.3717501764397), 485.708963532948, 880.531517490555, 2650155.92794626, (- 0.359287150025783), (- 656.991567673753), 2.41768149185367, 0.856873461222588, 0.655143675313458, (- 0.213535213206406), 0.00562974957606348, (- 316955725450471), (- 0.000699997000152457), 0.0119845803210767, 1.93848122022095e-05, (- 2.15095749182309e-05)];
v3_ps_part1_Ii = [(- 12.0), (- 12.0), (- 12.0), (- 10.0), (- 10.0), (- 10.0), (- 10.0), (- 8.0), (- 8.0), (- 8.0), (- 8.0), (- 6.0), (- 5.0), (- 4.0), (- 3.0), (- 3.0), (- 2.0), (- 2.0), (- 1.0), (- 1.0), 0.0, 0.0, 0.0, 1.0, 2.0, 4.0, 5.0, 6.0];
v3_ps_part1_Ji = [10.0, 12.0, 14.0, 4.0, 8.0, 10.0, 20.0, 5.0, 6.0, 14.0, 16.0, 28.0, 1.0, 5.0, 2.0, 4.0, 3.0, 8.0, 1.0, 2.0, 0.0, 1.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0];
v3_ps_part1_ni = [79.5544074093975, (- 2382.6124298459), 17681.3100617787, (- 0.00110524727080379), (- 15.3213833655326), 297.544599376982, (- 35031520.6871242), 0.277513761062119, (- 0.523964271036888), (- 148011.182995403), 1600148.99374266, 1708023226634.27, 0.000246866996006494, 1.6532608479798, (- 0.118008384666987), 2.537986423559, 0.965127704669424, (- 28.2172420532826), 0.203224612353823, 1.10648186063513, 0.52612794845128, 0.277000018736321, 1.08153340501132, (- 0.0744127885357893), 0.0164094443541384, (- 0.0680468275301065), 0.025798857610164, (- 0.000145749861944416)];
v3_ps_part2_Ii = [(- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 10.0), (- 10.0), (- 10.0), (- 10.0), (- 8.0), (- 5.0), (- 5.0), (- 5.0), (- 4.0), (- 4.0), (- 4.0), (- 4.0), (- 3.0), (- 2.0), (- 2.0), (- 2.0), (- 2.0), (- 2.0), (- 2.0), 0.0, 0.0, 0.0, 1.0, 1.0, 2.0];
v3_ps_part2_Ji = [0.0, 1.0, 2.0, 3.0, 5.0, 6.0, 0.0, 1.0, 2.0, 4.0, 0.0, 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 3.0, 1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 12.0, 0.0, 1.0, 2.0, 0.0, 2.0, 2.0];
v3_ps_part2_ni = [5.91599780322238e-05, (- 0.00185465997137856), 0.0104190510480013, 0.0059864730203859, (- 0.771391189901699), 1.72549765557036, (- 0.000467076079846526), 0.0134533823384439, (- 0.0808094336805495), 0.508139374365767, 0.00128584643361683, (- 1.63899353915435), 5.86938199318063, (- 2.92466667918613), (- 0.00614076301499537), 5.76199014049172, (- 12.1613320606788), 1.67637540957944, (- 7.44135838773463), 0.0378168091437659, 4.01432203027688, 16.0279837479185, 3.17848779347728, (- 3.58362310304853), (- 1159952.60446827), 0.199256573577909, (- 0.122270624794624), (- 19.1449143716586), (- 0.0150448002905284), 14.6407900162154, (- 3.2747778718823)];
p3_hs_part1_Ii = [0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0, 10.0, 10.0, 14.0, 18.0, 20.0, 22.0, 22.0, 24.0, 28.0, 28.0, 32.0, 32.0];
p3_hs_part1_Ji = [0.0, 1.0, 5.0, 0.0, 3.0, 4.0, 8.0, 14.0, 6.0, 16.0, 0.0, 2.0, 3.0, 0.0, 1.0, 4.0, 5.0, 28.0, 28.0, 24.0, 1.0, 32.0, 36.0, 22.0, 28.0, 36.0, 16.0, 28.0, 36.0, 16.0, 36.0, 10.0, 28.0];
p3_hs_part1_ni = [7.70889828326934, (- 26.0835009128688), 267.416218930389, 17.2221089496844, (- 293.54233214597), 614.135601882478, (- 61056.2757725674), (- 65127225.1118219), 73591.9313521937, (- 11664650591.4191), 35.5267086434461, (- 596.144543825955), (- 475.842430145708), 69.6781965359503, 335.674250377312, 25052.6809130882, 146997.380630766, 5.38069315091534e+19, 1.43619827291346e+21, 3.64985866165994e+19, (- 2547.41561156775), 2.40120197096563e+27, (- 3.93847464679496e+29), 1.47073407024852e+24, (- 4.26391250432059e+31), 1.94509340621077e+38, 6.66212132114896e+23, 7.06777016552858e+33, 1.75563621975576e+41, 1.08408607429124e+28, 7.30872705175151e+43, 1.5914584739887e+24, 3.77121605943324e+40];
p3_hs_part2_Ii = [(- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 12.0), (- 10.0), (- 10.0), (- 10.0), (- 10.0), (- 8.0), (- 8.0), (- 6.0), (- 6.0), (- 6.0), (- 6.0), (- 5.0), (- 4.0), (- 4.0), (- 4.0), (- 3.0), (- 3.0), (- 3.0), (- 3.0), (- 2.0), (- 2.0), (- 1.0), 0.0, 2.0, 2.0, 5.0, 6.0, 8.0, 10.0, 14.0, 14.0];
p3_hs_part2_Ji = [2.0, 10.0, 12.0, 14.0, 20.0, 2.0, 10.0, 14.0, 18.0, 2.0, 8.0, 2.0, 6.0, 7.0, 8.0, 10.0, 4.0, 5.0, 8.0, 1.0, 3.0, 5.0, 6.0, 0.0, 1.0, 0.0, 3.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 3.0, 7.0];
p3_hs_part2_ni = [1.25244360717979e-13, (- 0.0126599322553713), 5.06878030140626, 31.7847171154202, (- 391041.161399932), (- 9.75733406392044e-11), (- 18.6312419488279), 510.973543414101, 373847.005822362, 2.99804024666572e-08, 20.0544393820342, (- 4.98030487662829e-06), (- 10.230180636003), 55.2819126990325, (- 206.211367510878), (- 7940.12232324823), 7.82248472028153, (- 58.6544326902468), 3550.73647696481, (- 0.000115303107290162), (- 1.75092403171802), 257.98168774816, (- 727.048374179467), 0.000121644822609198, 0.0393137871762692, 0.00704181005909296, (- 82.910820069811), (- 0.26517881813125), 13.7531682453991, (- 52.2394090753046), 2405.56298941048, (- 22736.1631268929), 89074.6343932567, (- 23923456.5822486), 5687958081.29714];
h4_s_part1_Ii = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 8.0, 12.0, 12.0, 14.0, 14.0, 16.0, 20.0, 20.0, 22.0, 24.0, 28.0, 32.0, 32.0];
h4_s_part1_Ji = [14.0, 36.0, 3.0, 16.0, 0.0, 5.0, 4.0, 36.0, 4.0, 16.0, 24.0, 18.0, 24.0, 1.0, 4.0, 2.0, 4.0, 1.0, 22.0, 10.0, 12.0, 28.0, 8.0, 3.0, 0.0, 6.0, 8.0];
h4_s_part1_ni = [0.332171191705237, 0.000611217706323496, (- 8.82092478906822), (- 0.45562819254325), (- 2.63483840850452e-05), (- 22.3949661148062), (- 4.28398660164013), (- 0.616679338856916), (- 14.682303110404), 284.523138727299, (- 113.398503195444), 1156.71380760859, 395.551267359325, (- 1.54891257229285), 19.4486637751291, (- 3.57915139457043), (- 3.35369414148819), (- 0.66442679633246), 32332.1885383934, 3317.66744667084, (- 22350.1257931087), 5739538.75852936, 173.226193407919, (- 0.0363968822121321), 8.34596332878346e-07, 5.03611916682674, 65.5444787064505];
h4_s_part2_Ii = [0.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 7.0, 7.0, 7.0, 10.0, 10.0, 10.0, 32.0, 32.0];
h4_s_part2_Ji = [1.0, 4.0, 10.0, 16.0, 1.0, 36.0, 3.0, 16.0, 20.0, 36.0, 4.0, 2.0, 28.0, 32.0, 14.0, 32.0, 36.0, 0.0, 6.0];
h4_s_part2_ni = [0.822673364673336, 0.181977213534479, (- 0.011200026031362), (- 0.000746778287048033), (- 0.179046263257381), 0.0424220110836657, (- 0.341355823438768), (- 2.09881740853565), (- 8.22477343323596), (- 4.99684082076008), 0.191413958471069, 0.0581062241093136, (- 1655.05498701029), 1588.70443421201, (- 85.0623535172818), (- 31771.4386511207), (- 94589.0406632871), (- 1.3927384708869e-06), 0.63105253224098];
h4_s_part3_Ii = [0.0, 0.0, 0.0, 1.0, 1.0, 5.0, 6.0, 7.0, 8.0, 8.0, 12.0, 16.0, 22.0, 22.0, 24.0, 36.0];
h4_s_part3_Ji = [0.0, 3.0, 4.0, 0.0, 12.0, 36.0, 12.0, 16.0, 2.0, 20.0, 32.0, 36.0, 2.0, 32.0, 7.0, 20.0];
h4_s_part3_ni = [1.04351280732769, (- 2.27807912708513), 1.80535256723202, 0.420440834792042, (- 105721.24483466), 4.36911607493884e+24, (- 328032702839.753), (- 6786867608042700.0), 7439.57464645363, (- 3.56896445355761e+19), 1.67590585186801e+31, (- 3.55028625419105e+37), 396611982166.538, (- 4.14716268484468e+40), 3.59080103867382e+18, (- 1.16994334851995e+40)];
h4_s_part4_Ii = [1.0, 1.0, 2.0, 2.0, 4.0, 4.0, 7.0, 8.0, 8.0, 10.0, 12.0, 12.0, 18.0, 20.0, 24.0, 28.0, 28.0, 28.0, 28.0, 28.0, 32.0, 32.0, 32.0, 32.0, 32.0, 36.0, 36.0, 36.0, 36.0, 36.0];
h4_s_part4_Ji = [8.0, 24.0, 4.0, 32.0, 1.0, 2.0, 7.0, 5.0, 12.0, 1.0, 0.0, 7.0, 10.0, 12.0, 32.0, 8.0, 12.0, 20.0, 22.0, 24.0, 2.0, 7.0, 12.0, 14.0, 24.0, 10.0, 12.0, 20.0, 22.0, 28.0];
h4_s_part4_ni = [(- 524.581170928788), (- 9269472.18142218), (- 237.385107491666), 21077015581.2776, (- 23.9494562010986), 221.802480294197, (- 5104725.33393438), 1249813.96109147, 2000084369.96201, (- 815.158509791035), (- 157.612685637523), (- 11420042233.2791), 6623646807768720.0, (- 2.27622818296144e+18), (- 1.71048081348406e+31), 6607887669380910.0, 1.66320055886021e+22, (- 2.18003784381501e+29), (- 7.87276140295618e+29), 1.51062329700346e+31, 7957321.70300541, 1319576473553470.0, (- 3.2509706829914e+23), (- 4.18600611419248e+25), 2.97478906557467e+34, (- 9.53588761745473e+19), 1.66957699620939e+24, (- 1.75407764869978e+32), 3.47581490626396e+34, (- 7.10971318427851e+38)];
T4_hs_Ii = [0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 5.0, 5.0, 6.0, 6.0, 6.0, 8.0, 10.0, 10.0, 12.0, 14.0, 14.0, 16.0, 16.0, 18.0, 18.0, 18.0, 20.0, 28.0];
T4_hs_Ji = [0.0, 3.0, 12.0, 0.0, 1.0, 2.0, 5.0, 0.0, 5.0, 8.0, 0.0, 2.0, 3.0, 4.0, 0.0, 1.0, 1.0, 2.0, 4.0, 16.0, 6.0, 8.0, 22.0, 1.0, 20.0, 36.0, 24.0, 1.0, 28.0, 12.0, 32.0, 14.0, 22.0, 36.0, 24.0, 36.0];
T4_hs_ni = [0.179882673606601, (- 0.267507455199603), 1.162767226126, 0.147545428713616, (- 0.512871635973248), 0.421333567697984, 0.56374952218987, 0.429274443819153, (- 3.3570455214214), 10.8890916499278, (- 0.248483390456012), 0.30415322190639, (- 0.494819763939905), 1.07551674933261, 0.0733888415457688, 0.0140170545411085, (- 0.106110975998808), 0.0168324361811875, 1.25028363714877, 1013.16840309509, (- 1.51791558000712), 52.4277865990866, 23049.5545563912, 0.0249459806365456, 2107964.67412137, 366836848.613065, (- 144814105.365163), (- 0.0017927637300359), 4899556021.00459, 471.262212070518, (- 82929439019.8652), (- 1715.45662263191), 3557776.82973575, 586062760258.436, (- 12988763.5078195), 31724744937.1057];
reg5_Ji0 = [0.0, 1.0, (- 3.0), (- 2.0), (- 1.0), 2.0];
reg5_ni0 = [(- 13.179983674201), 6.8540841634434, (- 0.024805148933466), 0.36901534980333, (- 3.1161318213925), (- 0.32961626538917)];
reg5_Iir = [1.0, 1.0, 1.0, 2.0, 2.0, 3.0];
reg5_Jir = [1.0, 2.0, 3.0, 3.0, 9.0, 7.0];
reg5_nir = [0.0015736404855259, 0.00090153761673944, (- 0.0050270077677648), 2.2440037409485e-06, (- 4.1163275453471e-06), 3.7919454822955e-08];
p3sat_h_Ii = [0.0, 1.0, 1.0, 1.0, 1.0, 5.0, 7.0, 8.0, 14.0, 20.0, 22.0, 24.0, 28.0, 36.0];
p3sat_h_Ji = [0.0, 1.0, 3.0, 4.0, 36.0, 3.0, 0.0, 24.0, 16.0, 16.0, 3.0, 18.0, 8.0, 24.0];
p3sat_h_ni = [0.600073641753024, (- 9.36203654849857), 24.6590798594147, (- 107.014222858224), (- 91582131580576.8), (- 8623.32011700662), (- 23.5837344740032), 2.52304969384128e+17, (- 3.89718771997719e+18), (- 3.33775713645296e+22), 35649946963.6328, (- 1.48547544720641e+26), 3.30611514838798e+18, 8.13641294467829e+37];
p3sat_s_Ii = [0.0, 1.0, 1.0, 4.0, 12.0, 12.0, 16.0, 24.0, 28.0, 32.0];
p3sat_s_Ji = [0.0, 1.0, 32.0, 7.0, 4.0, 14.0, 36.0, 10.0, 0.0, 18.0];
p3sat_s_ni = [0.639767553612785, (- 12.9727445396014), (- 2245951258484030.0), 1774667.41801846, 7170793495.71538, (- 3.78829107169011e+17), (- 9.55586736431328e+34), 1.87269814676188e+23, 119254746466.473, 1.10649277244882e+36];
hB13_s_Ii = [0.0, 1.0, 1.0, 3.0, 5.0, 6.0];
hB13_s_Ji = [0.0, (- 2.0), 2.0, (- 12.0), (- 4.0), (- 3.0)];
hB13_s_ni = [0.913965547600543, (- 4.30944856041991e-05), 60.3235694765419, 1.17518273082168e-18, 0.220000904781292, (- 69.0815545851641)];
TB23_hs_Ii = [(- 12.0), (- 10.0), (- 8.0), (- 4.0), (- 3.0), (- 2.0), (- 2.0), (- 2.0), (- 2.0), 0.0, 1.0, 1.0, 1.0, 3.0, 3.0, 5.0, 6.0, 6.0, 8.0, 8.0, 8.0, 12.0, 12.0, 14.0, 14.0];
TB23_hs_Ji = [10.0, 8.0, 3.0, 4.0, 3.0, (- 6.0), 2.0, 3.0, 4.0, 0.0, (- 3.0), (- 2.0), 10.0, (- 2.0), (- 1.0), (- 5.0), (- 6.0), (- 3.0), (- 8.0), (- 2.0), (- 1.0), (- 12.0), (- 1.0), (- 12.0), 1.0];
TB23_hs_ni = [0.00062909626082981, (- 0.000823453502583165), 5.15446951519474e-08, (- 1.17565945784945), 3.48519684726192, (- 5.07837382408313e-12), (- 2.84637670005479), (- 2.36092263939673), 6.01492324973779, 1.48039650824546, 0.000360075182221907, (- 0.0126700045009952), (- 1221843.32521413), 0.149276502463272, 0.698733471798484, (- 0.0252207040114321), 0.0147151930985213, (- 1.08618917681849), (- 0.000936875039816322), 81.9877897570217, (- 182.041861521835), 2.61907376402688e-06, (- 29162.6417025961), 1.40660774926165e-05, 7832370.62349385];
my_pT_h0 = [0.5132047, 0.3205656, 0.0, 0.0, (- 0.7782567), 0.1885447];
my_pT_h1 = [0.2151778, 0.7317883, 1.241044, 1.476783, 0.0, 0.0];
my_pT_h2 = [(- 0.2818107), (- 1.070786), (- 1.263184), 0.0, 0.0, 0.0];
my_pT_h3 = [0.1778064, 0.460504, 0.2340379, (- 0.4924179), 0.0, 0.0];
my_pT_h4 = [(- 0.0417661), 0.0, 0.0, 0.1600435, 0.0, 0.0];
my_pT_h5 = [0.0, (- 0.01578386), 0.0, 0.0, 0.0, 0.0];
my_pT_h6 = [0.0, 0.0, 0.0, (- 0.003629481), 0.0, 0.0];
my_ph_h0 = [0.5132047, 0.3205656, 0.0, 0.0, (- 0.7782567), 0.1885447];
my_ph_h1 = [0.2151778, 0.7317883, 1.241044, 1.476783, 0.0, 0.0];
my_ph_h2 = [(- 0.2818107), (- 1.070786), (- 1.263184), 0.0, 0.0, 0.0];
my_ph_h3 = [0.1778064, 0.460504, 0.2340379, (- 0.4924179), 0.0, 0.0];
my_ph_h4 = [(- 0.0417661), 0.0, 0.0, 0.1600435, 0.0, 0.0];
my_ph_h5 = [0.0, (- 0.01578386), 0.0, 0.0, 0.0, 0.0];
my_ph_h6 = [0.0, 0.0, 0.0, (- 0.003629481), 0.0, 0.0];

function Tsat_p(p) {
	let fn_return_value;
	if (((0.000611657 <= p) && (p <= (22.06395 + 0.001)))) {
		fn_return_value = T4_p(p);
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}

function Tsat_s(s) {
	let fn_return_value;
	if ((((- 0.0001545495919) < s) && (s < 9.155759395))) {
		fn_return_value = T4_p(p4_s(s));
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}

function T_ph(p, h) {
	let fn_return_value, select_variable_0;
	select_variable_0 = region_ph(p, h);
	if ((select_variable_0 === 1)) {
		fn_return_value = T1_ph(p, h);
	} else {
		if ((select_variable_0 === 2)) {
			fn_return_value = T2_ph(p, h);
		} else {
			if ((select_variable_0 === 3)) {
				fn_return_value = T3_ph(p, h);
			} else {
				if ((select_variable_0 === 4)) {
					fn_return_value = T4_p(p);
				} else {
					if ((select_variable_0 === 5)) {
						fn_return_value = T5_ph(p, h);
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function T_ps(p, s) {
	let fn_return_value, select_variable_1;
	select_variable_1 = region_ps(p, s);
	if ((select_variable_1 === 1)) {
		fn_return_value = T1_ps(p, s);
	} else {
		if ((select_variable_1 === 2)) {
			fn_return_value = T2_ps(p, s);
		} else {
			if ((select_variable_1 === 3)) {
				fn_return_value = T3_ps(p, s);
			} else {
				if ((select_variable_1 === 4)) {
					fn_return_value = T4_p(p);
				} else {
					if ((select_variable_1 === 5)) {
						fn_return_value = T5_ps(p, s);
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function T_hs(h, s) {
	let fn_return_value, select_variable_2;
	select_variable_2 = Region_hs(h, s);
	if ((select_variable_2 === 1)) {
		fn_return_value = T1_ph(p1_hs(h, s), h);
	} else {
		if ((select_variable_2 === 2)) {
			fn_return_value = T2_ph(p2_hs(h, s), h);
		} else {
			if ((select_variable_2 === 3)) {
				fn_return_value = T3_ph(p3_hs(h, s), h);
			} else {
				if ((select_variable_2 === 4)) {
					fn_return_value = T4_hs(h, s);
				} else {
					if ((select_variable_2 === 5)) {
						fn_return_value = Number.NaN;
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function psat_T(T) {
	let fn_return_value;
	if (((647.096 >= T) && (T > 273.15))) {
		fn_return_value = p4_T(T);
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function psat_s(s) {
	let fn_return_value;
	if ((((- 0.0001545495919) < s) && (s < 9.155759395))) {
		fn_return_value = p4_s(s);
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function p_hs(h, s) {
	let fn_return_value, select_variable_3;
	select_variable_3 = Region_hs(h, s);
	if ((select_variable_3 === 1)) {
		fn_return_value = p1_hs(h, s);
	} else {
		if ((select_variable_3 === 2)) {
			fn_return_value = p2_hs(h, s);
		} else {
			if ((select_variable_3 === 3)) {
				fn_return_value = p3_hs(h, s);
			} else {
				if ((select_variable_3 === 4)) {
					fn_return_value = p4_T(T4_hs(h, s));
				} else {
					if ((select_variable_3 === 5)) {
						fn_return_value = Number.NaN;
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function p_hrho(h, rho) {
	let High_Bound, Low_Bound, fn_return_value, iter_count, p, rhos;
	High_Bound = 100;
	Low_Bound = 0.000611657;
	p = 10;
	rhos = (1 / v_ph(p, h));
	iter_count = 0;
	while (((Math.abs((rho - rhos)) > 1e-07) && (iter_count < 1000))) {
		rhos = (1 / v_ph(p, h));
		if ((rhos >= rho)) {
			High_Bound = p;
		} else {
			Low_Bound = p;
		}
		p = ((Low_Bound + High_Bound) / 2);
		iter_count += 1;
	}
	if ((iter_count >= 1000)) {
		p = Number.NaN;
	}
	fn_return_value = p;
	return fn_return_value;
}
function hV_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		fn_return_value = h4V_p(p);
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function hL_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		fn_return_value = h4L_p(p);
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function hV_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		fn_return_value = h4V_p(p4_T(T));
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function hL_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		fn_return_value = h4L_p(p4_T(T));
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function h_pT(p, T) {
	let fn_return_value, select_variable_4;
	select_variable_4 = region_pT(p, T);
	if ((select_variable_4 === 1)) {
		fn_return_value = h1_pT(p, T);
	} else {
		if ((select_variable_4 === 2)) {
			fn_return_value = h2_pT(p, T);
		} else {
			if ((select_variable_4 === 3)) {
				fn_return_value = h3_pT(p, T);
			} else {
				if ((select_variable_4 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_4 === 5)) {
						fn_return_value = h5_pT(p, T);
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function h_ps(p, s) {
	let fn_return_value, select_variable_5, xs;
	select_variable_5 = region_ps(p, s);
	if ((select_variable_5 === 1)) {
		fn_return_value = h1_pT(p, T1_ps(p, s));
	} else {
		if ((select_variable_5 === 2)) {
			fn_return_value = h2_pT(p, T2_ps(p, s));
		} else {
			if ((select_variable_5 === 3)) {
				fn_return_value = h3_rhoT((1 / v3_ps(p, s)), T3_ps(p, s));
			} else {
				if ((select_variable_5 === 4)) {
					xs = x4_ps(p, s);
					fn_return_value = ((xs * h4V_p(p)) + ((1 - xs) * h4L_p(p)));
				} else {
					if ((select_variable_5 === 5)) {
						fn_return_value = h5_pT(p, T5_ps(p, s));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function h_px(p, x) {console.log("p",p);
	let fn_return_value, hL, hV;
	if ((((x > 1) || (x < 0)) || (p >= 22.064))) {
		fn_return_value = Number.NaN;
		return fn_return_value;
	}
	hL = h4L_p(p);
	hV = h4V_p(p);console.log(h4V_p(p));
	fn_return_value = (hL + (x * (hV - hL)));
	return fn_return_value;
}
function h_Tx(T, x) {
	let fn_return_value, hL, hV, p;
	if ((((x > 1) || (x < 0)) || (T >= 647.096))) {
		fn_return_value = Number.NaN;
		return fn_return_value;
	}
	p = p4_T(T);
	hL = h4L_p(p);
	hV = h4V_p(p);
	fn_return_value = (hL + (x * (hV - hL)));
	return fn_return_value;
}
function h_prho(p, rho) {
	let fn_return_value, hL, hV, select_variable_6, vL, vV, x;
	rho = (1 / (1 / rho));
	select_variable_6 = Region_prho(p, rho);
	if ((select_variable_6 === 1)) {
		fn_return_value = h1_pT(p, T1_prho(p, rho));
	} else {
		if ((select_variable_6 === 2)) {
			fn_return_value = h2_pT(p, T2_prho(p, rho));
		} else {
			if ((select_variable_6 === 3)) {
				fn_return_value = h3_rhoT(rho, T3_prho(p, rho));
			} else {
				if ((select_variable_6 === 4)) {
					if ((p < 16.529)) {
						vV = v2_pT(p, T4_p(p));
						vL = v1_pT(p, T4_p(p));
					} else {
						vV = v3_ph(p, h4V_p(p));
						vL = v3_ph(p, h4L_p(p));
					}
					hV = h4V_p(p);
					hL = h4L_p(p);
					x = (((1 / rho) - vL) / (vV - vL));
					fn_return_value = (((1 - x) * hL) + (x * hV));
				} else {
					if ((select_variable_6 === 5)) {
						fn_return_value = h5_pT(p, T5_prho(p, rho));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function vV_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = v2_pT(p, T4_p(p));
		} else {
			fn_return_value = v3_ph(p, h4V_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function vL_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = v1_pT(p, T4_p(p));
		} else {
			fn_return_value = v3_ph(p, h4L_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function vV_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = v2_pT(p4_T(T), T);
		} else {
			fn_return_value = v3_ph(p4_T(T), h4V_p(p4_T(T)));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function vL_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = v1_pT(p4_T(T), T);
		} else {
			fn_return_value = v3_ph(p4_T(T), h4L_p(p4_T(T)));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function v_pT(p, T) {
	let fn_return_value, select_variable_7;
	select_variable_7 = region_pT(p, T);
	if ((select_variable_7 === 1)) {
		fn_return_value = v1_pT(p, T);
	} else {
		if ((select_variable_7 === 2)) {
			fn_return_value = v2_pT(p, T);
		} else {
			if ((select_variable_7 === 3)) {
				fn_return_value = v3_ph(p, h3_pT(p, T));
			} else {
				if ((select_variable_7 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_7 === 5)) {
						fn_return_value = v5_pT(p, T);
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function v_ph(p, h) {
	let fn_return_value, select_variable_8, v4L, v4V, xs;

	select_variable_8 = region_ph(p, h);
	if ((select_variable_8 === 1)) {
		fn_return_value = v1_pT(p, T1_ph(p, h));
	} else {
		if ((select_variable_8 === 2)) {
			fn_return_value = v2_pT(p, T2_ph(p, h));
		} else {
			if ((select_variable_8 === 3)) {
				fn_return_value = v3_ph(p, h);
			} else {
				if ((select_variable_8 === 4)) {
					xs = x4_ph(p, h);
					if ((p < 16.529)) {
						v4V = v2_pT(p, T4_p(p));
						v4L = v1_pT(p, T4_p(p));
					} else {
						v4V = v3_ph(p, h4V_p(p));
						v4L = v3_ph(p, h4L_p(p));
					}
					fn_return_value = ((xs * v4V) + ((1 - xs) * v4L));
				} else {
					if ((select_variable_8 === 5)) {
						fn_return_value = v5_pT(p, T5_ph(p, h));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function v_ps(p, s) {
	let fn_return_value, select_variable_9, v4L, v4V, xs;

	select_variable_9 = region_ps(p, s);
	if ((select_variable_9 === 1)) {
		fn_return_value = v1_pT(p, T1_ps(p, s));
	} else {
		if ((select_variable_9 === 2)) {
			fn_return_value = v2_pT(p, T2_ps(p, s));
		} else {
			if ((select_variable_9 === 3)) {
				fn_return_value = v3_ps(p, s);
			} else {
				if ((select_variable_9 === 4)) {
					xs = x4_ps(p, s);
					if ((p < 16.529)) {
						v4V = v2_pT(p, T4_p(p));
						v4L = v1_pT(p, T4_p(p));
					} else {
						v4V = v3_ph(p, h4V_p(p));
						v4L = v3_ph(p, h4L_p(p));
					}
					fn_return_value = ((xs * v4V) + ((1 - xs) * v4L));
				} else {
					if ((select_variable_9 === 5)) {
						fn_return_value = v5_pT(p, T5_ps(p, s));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function rhoV_p(p) {
	let fn_return_value;
	fn_return_value = (1 / vV_p(p));
	return fn_return_value;
}
function rhoL_p(p) {
	let fn_return_value;
	fn_return_value = (1 / vL_p(p));
	return fn_return_value;
}
function rhoL_T(T) {
	let fn_return_value;
	fn_return_value = (1 / vL_T(T));
	return fn_return_value;
}
function rhoV_T(T) {
	let fn_return_value;
	fn_return_value = (1 / vV_T(T));
	return fn_return_value;
}
function rho_pT(p, T) {
	let fn_return_value;
	fn_return_value = (1 / v_pT(p, T));
	return fn_return_value;
}
function rho_ph(p, h) {
	let fn_return_value;
	fn_return_value = (1 / v_ph(p, h));
	return fn_return_value;
}
function rho_ps(p, s) {
	let fn_return_value;
	fn_return_value = (1 / v_ps(p, s));
	return fn_return_value;
}
function sV_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = s2_pT(p, T4_p(p));
		} else {
			fn_return_value = s3_rhoT((1 / v3_ph(p, h4V_p(p))), T4_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function sL_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = s1_pT(p, T4_p(p));
		} else {
			fn_return_value = s3_rhoT((1 / v3_ph(p, h4L_p(p))), T4_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function sV_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = s2_pT(p4_T(T), T);
		} else {
			fn_return_value = s3_rhoT((1 / v3_ph(p4_T(T), h4V_p(p4_T(T)))), T);
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function sL_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = s1_pT(p4_T(T), T);
		} else {
			fn_return_value = s3_rhoT((1 / v3_ph(p4_T(T), h4L_p(p4_T(T)))), T);
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function s_pT(p, T) {
	let fn_return_value, select_variable_10;
	select_variable_10 = region_pT(p, T);
	if ((select_variable_10 === 1)) {
		fn_return_value = s1_pT(p, T);
	} else {
		if ((select_variable_10 === 2)) {
			fn_return_value = s2_pT(p, T);
		} else {
			if ((select_variable_10 === 3)) {
				fn_return_value = s3_rhoT((1 / v3_ph(p, h3_pT(p, T))), T);
			} else {
				if ((select_variable_10 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_10 === 5)) {
						fn_return_value = s5_pT(p, T);
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function s_ph(p, h) {
	let Ts, fn_return_value, s4L, s4V, select_variable_11, v4L, v4V, xs;

	select_variable_11 = region_ph(p, h);
	if ((select_variable_11 === 1)) {
		fn_return_value = s1_pT(p, T1_ph(p, h));
	} else {
		if ((select_variable_11 === 2)) {
			fn_return_value = s2_pT(p, T2_ph(p, h));
		} else {
			if ((select_variable_11 === 3)) {
				fn_return_value = s3_rhoT((1 / v3_ph(p, h)), T3_ph(p, h));
			} else {
				if ((select_variable_11 === 4)) {
					Ts = T4_p(p);
					xs = x4_ph(p, h);
					if ((p < 16.529)) {
						s4V = s2_pT(p, Ts);
						s4L = s1_pT(p, Ts);
					} else {
						v4V = v3_ph(p, h4V_p(p));
						s4V = s3_rhoT((1 / v4V), Ts);
						v4L = v3_ph(p, h4L_p(p));
						s4L = s3_rhoT((1 / v4L), Ts);
					}
					fn_return_value = ((xs * s4V) + ((1 - xs) * s4L));
				} else {
					if ((select_variable_11 === 5)) {
						fn_return_value = s5_pT(p, T5_ph(p, h));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function uV_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = u2_pT(p, T4_p(p));
		} else {
			fn_return_value = u3_rhoT((1 / v3_ph(p, h4V_p(p))), T4_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function uL_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = u1_pT(p, T4_p(p));
		} else {
			fn_return_value = u3_rhoT((1 / v3_ph(p, h4L_p(p))), T4_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function uV_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = u2_pT(p4_T(T), T);
		} else {
			fn_return_value = u3_rhoT((1 / v3_ph(p4_T(T), h4V_p(p4_T(T)))), T);
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function uL_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = u1_pT(p4_T(T), T);
		} else {
			fn_return_value = u3_rhoT((1 / v3_ph(p4_T(T), h4L_p(p4_T(T)))), T);
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function u_pT(p, T) {
	let fn_return_value, select_variable_12;
	select_variable_12 = region_pT(p, T);
	if ((select_variable_12 === 1)) {
		fn_return_value = u1_pT(p, T);
	} else {
		if ((select_variable_12 === 2)) {
			fn_return_value = u2_pT(p, T);
		} else {
			if ((select_variable_12 === 3)) {
				fn_return_value = u3_rhoT((1 / v3_ph(p, h3_pT(p, T))), T);
			} else {
				if ((select_variable_12 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_12 === 5)) {
						fn_return_value = u5_pT(p, T);
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function u_ph(p, h) {
	let Ts, fn_return_value, select_variable_13, u4L, u4v, v4L, v4V, xs;

	select_variable_13 = region_ph(p, h);
	if ((select_variable_13 === 1)) {
		fn_return_value = u1_pT(p, T1_ph(p, h));
	} else {
		if ((select_variable_13 === 2)) {
			fn_return_value = u2_pT(p, T2_ph(p, h));
		} else {
			if ((select_variable_13 === 3)) {
				fn_return_value = u3_rhoT((1 / v3_ph(p, h)), T3_ph(p, h));
			} else {
				if ((select_variable_13 === 4)) {
					Ts = T4_p(p);
					xs = x4_ph(p, h);
					if ((p < 16.529)) {
						u4v = u2_pT(p, Ts);
						u4L = u1_pT(p, Ts);
					} else {
						v4V = v3_ph(p, h4V_p(p));
						u4v = u3_rhoT((1 / v4V), Ts);
						v4L = v3_ph(p, h4L_p(p));
						u4L = u3_rhoT((1 / v4L), Ts);
					}
					fn_return_value = ((xs * u4v) + ((1 - xs) * u4L));
				} else {
					if ((select_variable_13 === 5)) {
						Ts = T5_ph(p, h);
						fn_return_value = u5_pT(p, Ts);
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function u_ps(p, s) {
	let fn_return_value, select_variable_14, uLp, uVp, x;

	select_variable_14 = region_ps(p, s);
	if ((select_variable_14 === 1)) {
		fn_return_value = u1_pT(p, T1_ps(p, s));
	} else {
		if ((select_variable_14 === 2)) {
			fn_return_value = u2_pT(p, T2_ps(p, s));
		} else {
			if ((select_variable_14 === 3)) {
				fn_return_value = u3_rhoT((1 / v3_ps(p, s)), T3_ps(p, s));
			} else {
				if ((select_variable_14 === 4)) {
					if ((p < 16.529)) {
						uLp = u1_pT(p, T4_p(p));
						uVp = u2_pT(p, T4_p(p));
					} else {
						uLp = u3_rhoT((1 / v3_ph(p, h4L_p(p))), T4_p(p));
						uVp = u3_rhoT((1 / v3_ph(p, h4V_p(p))), T4_p(p));
					}
					x = x4_ps(p, s);
					fn_return_value = ((x * uVp) + ((1 - x) * uLp));
				} else {
					if ((select_variable_14 === 5)) {
						fn_return_value = u5_pT(p, T5_ps(p, s));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function CpV_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = Cp2_pT(p, T4_p(p));
		} else {
			fn_return_value = Cp3_rhoT((1 / v3_ph(p, h4V_p(p))), T4_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function CpL_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = Cp1_pT(p, T4_p(p));
		} else {
			// T = T4_p(p);
			// h = h4L_p(p);
			// v = v3_ph(p, h4L_p(p));
			fn_return_value = Cp3_rhoT((1 / v3_ph(p, h4L_p(p))), T4_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function CpV_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = Cp2_pT(p4_T(T), T);
		} else {
			fn_return_value = Cp3_rhoT((1 / v3_ph(p4_T(T), h4V_p(p4_T(T)))), T);
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function CpL_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = Cp1_pT(p4_T(T), T);
		} else {
			fn_return_value = Cp3_rhoT((1 / v3_ph(p4_T(T), h4L_p(p4_T(T)))), T);
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function Cp_pT(p, T) {
	let fn_return_value, select_variable_15;
	select_variable_15 = region_pT(p, T);
	if ((select_variable_15 === 1)) {
		fn_return_value = Cp1_pT(p, T);
	} else {
		if ((select_variable_15 === 2)) {
			fn_return_value = Cp2_pT(p, T);
		} else {
			if ((select_variable_15 === 3)) {
				fn_return_value = Cp3_rhoT((1 / v3_ph(p, h3_pT(p, T))), T);
			} else {
				if ((select_variable_15 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_15 === 5)) {
						fn_return_value = Cp5_pT(p, T);
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function Cp_ph(p, h) {
	let fn_return_value, select_variable_16;

	select_variable_16 = region_ph(p, h);
	if ((select_variable_16 === 1)) {
		fn_return_value = Cp1_pT(p, T1_ph(p, h));
	} else {
		if ((select_variable_16 === 2)) {
			fn_return_value = Cp2_pT(p, T2_ph(p, h));
		} else {
			if ((select_variable_16 === 3)) {
				fn_return_value = Cp3_rhoT((1 / v3_ph(p, h)), T3_ph(p, h));
			} else {
				if ((select_variable_16 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_16 === 5)) {
						fn_return_value = Cp5_pT(p, T5_ph(p, h));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function Cp_ps(p, s) {
	let fn_return_value, select_variable_17;

	select_variable_17 = region_ps(p, s);
	if ((select_variable_17 === 1)) {
		fn_return_value = Cp1_pT(p, T1_ps(p, s));
	} else {
		if ((select_variable_17 === 2)) {
			fn_return_value = Cp2_pT(p, T2_ps(p, s));
		} else {
			if ((select_variable_17 === 3)) {
				fn_return_value = Cp3_rhoT((1 / v3_ps(p, s)), T3_ps(p, s));
			} else {
				if ((select_variable_17 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_17 === 5)) {
						fn_return_value = Cp5_pT(p, T5_ps(p, s));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function CvV_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = Cv2_pT(p, T4_p(p));
		} else {
			fn_return_value = Cv3_rhoT((1 / v3_ph(p, h4V_p(p))), T4_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function CvL_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = Cv1_pT(p, T4_p(p));
		} else {
			fn_return_value = Cv3_rhoT((1 / v3_ph(p, h4L_p(p))), T4_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function CvV_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = Cv2_pT(p4_T(T), T);
		} else {
			fn_return_value = Cv3_rhoT((1 / v3_ph(p4_T(T), h4V_p(p4_T(T)))), T);
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function CvL_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = Cv1_pT(p4_T(T), T);
		} else {
			fn_return_value = Cv3_rhoT((1 / v3_ph(p4_T(T), h4L_p(p4_T(T)))), T);
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function Cv_pT(p, T) {
	let fn_return_value, select_variable_18;
	select_variable_18 = region_pT(p, T);
	if ((select_variable_18 === 1)) {
		fn_return_value = Cv1_pT(p, T);
	} else {
		if ((select_variable_18 === 2)) {
			fn_return_value = Cv2_pT(p, T);
		} else {
			if ((select_variable_18 === 3)) {
				fn_return_value = Cv3_rhoT((1 / v3_ph(p, h3_pT(p, T))), T);
			} else {
				if ((select_variable_18 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_18 === 5)) {
						fn_return_value = Cv5_pT(p, T);
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function Cv_ph(p, h) {
	let fn_return_value, select_variable_19;

	select_variable_19 = region_ph(p, h);
	if ((select_variable_19 === 1)) {
		fn_return_value = Cv1_pT(p, T1_ph(p, h));
	} else {
		if ((select_variable_19 === 2)) {
			fn_return_value = Cv2_pT(p, T2_ph(p, h));
		} else {
			if ((select_variable_19 === 3)) {
				fn_return_value = Cv3_rhoT((1 / v3_ph(p, h)), T3_ph(p, h));
			} else {
				if ((select_variable_19 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_19 === 5)) {
						fn_return_value = Cv5_pT(p, T5_ph(p, h));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function Cv_ps(p, s) {
	let fn_return_value, select_variable_20;
	select_variable_20 = region_ps(p, s);
	if ((select_variable_20 === 1)) {
		fn_return_value = Cv1_pT(p, T1_ps(p, s));
	} else {
		if ((select_variable_20 === 2)) {
			fn_return_value = Cv2_pT(p, T2_ps(p, s));
		} else {
			if ((select_variable_20 === 3)) {
				fn_return_value = Cv3_rhoT((1 / v3_ps(p, s)), T3_ps(p, s));
			} else {
				if ((select_variable_20 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_20 === 5)) {
						fn_return_value = Cv5_pT(p, T5_ps(p, s));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function wV_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = w2_pT(p, T4_p(p));
		} else {
			fn_return_value = w3_rhoT((1 / v3_ph(p, h4V_p(p))), T4_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function wL_p(p) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			fn_return_value = w1_pT(p, T4_p(p));
		} else {
			fn_return_value = w3_rhoT((1 / v3_ph(p, h4L_p(p))), T4_p(p));
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function wV_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = w2_pT(p4_T(T), T);
		} else {
			fn_return_value = w3_rhoT((1 / v3_ph(p4_T(T), h4V_p(p4_T(T)))), T);
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function wL_T(T) {
	let fn_return_value;
	if (((273.15 < T) && (T < 647.096))) {
		if ((T <= 623.15)) {
			fn_return_value = w1_pT(p4_T(T), T);
		} else {
			fn_return_value = w3_rhoT((1 / v3_ph(p4_T(T), h4L_p(p4_T(T)))), T);
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function w_pT(p, T) {
	let fn_return_value, select_variable_21;
	select_variable_21 = region_pT(p, T);
	if ((select_variable_21 === 1)) {
		fn_return_value = w1_pT(p, T);
	} else {
		if ((select_variable_21 === 2)) {
			fn_return_value = w2_pT(p, T);
		} else {
			if ((select_variable_21 === 3)) {
				fn_return_value = w3_rhoT((1 / v3_ph(p, h3_pT(p, T))), T);
			} else {
				if ((select_variable_21 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_21 === 5)) {
						fn_return_value = w5_pT(p, T);
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function w_ph(p, h) {
	let fn_return_value, select_variable_22;
	select_variable_22 = region_ph(p, h);
	if ((select_variable_22 === 1)) {
		fn_return_value = w1_pT(p, T1_ph(p, h));
	} else {
		if ((select_variable_22 === 2)) {
			fn_return_value = w2_pT(p, T2_ph(p, h));
		} else {
			if ((select_variable_22 === 3)) {
				fn_return_value = w3_rhoT((1 / v3_ph(p, h)), T3_ph(p, h));
			} else {
				if ((select_variable_22 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_22 === 5)) {
						fn_return_value = w5_pT(p, T5_ph(p, h));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function w_ps(p, s) {
	let fn_return_value, select_variable_23;
	select_variable_23 = region_ps(p, s);
	if ((select_variable_23 === 1)) {
		fn_return_value = w1_pT(p, T1_ps(p, s));
	} else {
		if ((select_variable_23 === 2)) {
			fn_return_value = w2_pT(p, T2_ps(p, s));
		} else {
			if ((select_variable_23 === 3)) {
				fn_return_value = w3_rhoT((1 / v3_ps(p, s)), T3_ps(p, s));
			} else {
				if ((select_variable_23 === 4)) {
					fn_return_value = Number.NaN;
				} else {
					if ((select_variable_23 === 5)) {
						fn_return_value = w5_pT(p, T5_ps(p, s));
					} else {
						fn_return_value = Number.NaN;
					}
				}
			}
		}
	}
	return fn_return_value;
}
function my_pT(p, T) {
	let fn_return_value, select_variable_24;
	select_variable_24 = region_pT(p, T);
	if ((select_variable_24 === 4)) {
		fn_return_value = Number.NaN;
	} else {
		if (((((select_variable_24 === 1) || (select_variable_24 === 2)) || (select_variable_24 === 3)) || (select_variable_24 === 5))) {
			fn_return_value = my_AllRegions_pT(p, T);
		} else {
			fn_return_value = Number.NaN;
		}
	}
	return fn_return_value;
}
function my_ph(p, h) {
	let fn_return_value, select_variable_25;
	select_variable_25 = region_ph(p, h);
	if (((((select_variable_25 === 1) || (select_variable_25 === 2)) || (select_variable_25 === 3)) || (select_variable_25 === 5))) {
		fn_return_value = my_AllRegions_ph(p, h);
	} else {
		if ((select_variable_25 === 4)) {
			fn_return_value = Number.NaN;
		} else {
			fn_return_value = Number.NaN;
		}
	}
	return fn_return_value;
}
function my_ps(p, s) {
	let fn_return_value;
	fn_return_value = my_ph(p, h_ps(p, s));
	return fn_return_value;
}
function Pr_pT(p, T) {
	let Cp, fn_return_value, my, tc;
	Cp = Cp_pT(p, T);
	my = my_pT(p, T);
	tc = tc_pT(p, T);
	fn_return_value = (((Cp * 1000) * my) / tc);
	return fn_return_value;
}
function Pr_ph(p, h) {
	let Cp, fn_return_value, my, tc;
	Cp = Cp_ph(p, h);
	my = my_ph(p, h);
	tc = tc_ph(p, h);
	fn_return_value = (((Cp * 1000) * my) / tc);
	return fn_return_value;
}
function Kappa_pT(p, T) {
	let Cp, Cv, fn_return_value;
	Cp = Cp_pT(p, T);
	Cv = Cv_pT(p, T);
	fn_return_value = (Cp / Cv);
	return fn_return_value;
}
function Kappa_ph(p, h) {
	let Cp, Cv, fn_return_value;
	Cv = Cv_ph(p, h);
	Cp = Cp_ph(p, h);
	fn_return_value = (Cp / Cv);
	return fn_return_value;
}
function st_T(T) {
	let fn_return_value;
	fn_return_value = Surface_Tension_T(T);
	return fn_return_value;
}
function st_p(p) {
	let T, fn_return_value;
	T = Tsat_p(p);
	fn_return_value = Surface_Tension_T(T);
	return fn_return_value;
}
function tcL_p(p) {
	let T, fn_return_value, v;
	T = Tsat_p(p);
	v = vL_p(p);
	fn_return_value = tc_ptrho(p, T, (1 / v));
	return fn_return_value;
}
function tcV_p(p) {
	let T, fn_return_value, v;
	T = Tsat_p(p);
	v = vV_p(p);
	fn_return_value = tc_ptrho(p, T, (1 / v));
	return fn_return_value;
}
function tcL_T(T) {
	let fn_return_value, p, v;
	p = psat_T(T);
	v = vL_T(T);
	fn_return_value = tc_ptrho(p, T, (1 / v));
	return fn_return_value;
}
function tcV_T(T) {
	let fn_return_value, p, v;
	p = psat_T(T);
	v = vV_T(T);
	fn_return_value = tc_ptrho(p, T, (1 / v));
	return fn_return_value;
}
function tc_pT(p, T) {
	let fn_return_value, v;
	v = v_pT(p, T);
	fn_return_value = tc_ptrho(p, T, (1 / v));
	return fn_return_value;
}
function tc_ph(p, h) {
	let T, fn_return_value, v;
	v = v_ph(p, h);
	T = T_ph(p, h);
	fn_return_value = tc_ptrho(p, T, (1 / v));
	return fn_return_value;
}
function tc_hs(h, s) {
	let T, fn_return_value, p, v;
	p = p_hs(h, s);
	v = v_ph(p, h);
	T = T_ph(p, h);
	fn_return_value = tc_ptrho(p, T, (1 / v));
	return fn_return_value;
}
function x_ph(p, h) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		fn_return_value = x4_ph(p, h);
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function x_ps(p, s) {
	let fn_return_value;
	if (((0.000611657 < p) && (p < 22.06395))) {
		fn_return_value = x4_ps(p, s);
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function vx_ph(p, h) {
	let fn_return_value, vL, vV, xs;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			vL = v1_pT(p, T4_p(p));
			vV = v2_pT(p, T4_p(p));
		} else {
			vL = v3_ph(p, h4L_p(p));
			vV = v3_ph(p, h4V_p(p));
		}
		xs = x4_ph(p, h);
		fn_return_value = ((xs * vV) / ((xs * vV) + ((1 - xs) * vL)));
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function vx_ps(p, s) {
	let fn_return_value, vL, vV, xs;
	if (((0.000611657 < p) && (p < 22.06395))) {
		if ((p < 16.529)) {
			vL = v1_pT(p, T4_p(p));
			vV = v2_pT(p, T4_p(p));
		} else {
			vL = v3_ph(p, h4L_p(p));
			vV = v3_ph(p, h4V_p(p));
		}
		xs = x4_ps(p, s);
		fn_return_value = ((xs * vV) / ((xs * vV) + ((1 - xs) * vL)));
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function v1_pT(p, T) {
	let R, fn_return_value, g_p, ps, tau;
	R = 0.461526;
	ps = (p / 16.53);
	tau = (1386 / T);
	g_p = 0;
	let i = 0;
	const _pj_a = 34;
	for (; (i < _pj_a); i += 1) {
		g_p = (g_p - (((reg1_n1[i] * reg1_I1[i]) * Math.pow((7.1 - ps), (reg1_I1[i] - 1))) * Math.pow((tau - 1.222), reg1_J1[i])));
	}
	fn_return_value = (((((R * T) / p) * ps) * g_p) / 1000);
	return fn_return_value;
}
function h1_pT(p, T) {
	let R, fn_return_value, g_t, tau;
	R = 0.461526;
	p = (p / 16.53);
	tau = (1386 / T);
	g_t = 0;
	let i = 0;
	const _pj_a = 34;
	for (; (i < _pj_a); i += 1) {
		g_t = (g_t + (((reg1_n1[i] * Math.pow((7.1 - p), reg1_I1[i])) * reg1_J1[i]) * Math.pow((tau - 1.222), (reg1_J1[i] - 1))));
	}
	fn_return_value = (((R * T) * tau) * g_t);
	return fn_return_value;
}
function u1_pT(p, T) {
	let R, fn_return_value, g_p, g_t, tau;
	R = 0.461526;
	p = (p / 16.53);
	tau = (1386 / T);
	g_t = 0;
	g_p = 0;
	let i = 0;
	const _pj_a = 34;
	for (; (i < _pj_a); i += 1) {
		g_p = (g_p - (((reg1_n1[i] * reg1_I1[i]) * Math.pow((7.1 - p), (reg1_I1[i] - 1))) * Math.pow((tau - 1.222), reg1_J1[i])));
		g_t = (g_t + (((reg1_n1[i] * Math.pow((7.1 - p), reg1_I1[i])) * reg1_J1[i]) * Math.pow((tau - 1.222), (reg1_J1[i] - 1))));
	}
	fn_return_value = ((R * T) * ((tau * g_t) - (p * g_p)));
	return fn_return_value;
}
function s1_pT(p, T) {
	let R, fn_return_value, g, g_t;
	R = 0.461526;
	p = (p / 16.53);
	T = (1386 / T);
	g = 0;
	g_t = 0;
	let i = 0;
	const _pj_a = 34;
	for (; (i < _pj_a); i += 1) {
		g_t = (g_t + (((reg1_n1[i] * Math.pow((7.1 - p), reg1_I1[i])) * reg1_J1[i]) * Math.pow((T - 1.222), (reg1_J1[i] - 1))));
		g = (g + ((reg1_n1[i] * Math.pow((7.1 - p), reg1_I1[i])) * Math.pow((T - 1.222), reg1_J1[i])));
	}
	fn_return_value = (((R * T) * g_t) - (R * g));
	return fn_return_value;
}
function Cp1_pT(p, T) {
	let G_tt, R, fn_return_value;
	R = 0.461526;
	p = (p / 16.53);
	T = (1386 / T);
	G_tt = 0;
	let i = 0;
	const _pj_a = 34;
	for (; (i < _pj_a); i += 1) {
		G_tt = (G_tt + ((((reg1_n1[i] * Math.pow((7.1 - p), reg1_I1[i])) * reg1_J1[i]) * (reg1_J1[i] - 1)) * Math.pow((T - 1.222), (reg1_J1[i] - 2))));
	}
	fn_return_value = (((- R) * Math.pow(T, 2)) * G_tt);
	return fn_return_value;
}
function Cv1_pT(p, T) {
	let G_tt, R, fn_return_value, g_p, g_pp, g_pt;
	R = 0.461526;
	p = (p / 16.53);
	T = (1386 / T);
	g_p = 0;
	g_pp = 0;
	g_pt = 0;
	G_tt = 0;
	let i = 0;
	const _pj_a = 34;
	for (; (i < _pj_a); i += 1) {
		g_p = (g_p - (((reg1_n1[i] * reg1_I1[i]) * Math.pow((7.1 - p), (reg1_I1[i] - 1))) * Math.pow((T - 1.222), reg1_J1[i])));
		g_pp = (g_pp + ((((reg1_n1[i] * reg1_I1[i]) * (reg1_I1[i] - 1)) * Math.pow((7.1 - p), (reg1_I1[i] - 2))) * Math.pow((T - 1.222), reg1_J1[i])));
		g_pt = (g_pt - ((((reg1_n1[i] * reg1_I1[i]) * Math.pow((7.1 - p), (reg1_I1[i] - 1))) * reg1_J1[i]) * Math.pow((T - 1.222), (reg1_J1[i] - 1))));
		G_tt = (G_tt + ((((reg1_n1[i] * Math.pow((7.1 - p), reg1_I1[i])) * reg1_J1[i]) * (reg1_J1[i] - 1)) * Math.pow((T - 1.222), (reg1_J1[i] - 2))));
	}
	fn_return_value = (R * ((- (Math.pow(T, 2) * G_tt)) + (Math.pow((g_p - (T * g_pt)), 2) / g_pp)));
	return fn_return_value;
}
function w1_pT(p, T) {
	let G_tt, R, fn_return_value, g_p, g_pp, g_pt, tau;
	R = 0.461526;
	p = (p / 16.53);
	tau = (1386 / T);
	g_p = 0;
	g_pp = 0;
	g_pt = 0;
	G_tt = 0;
	let i = 0;
	const _pj_a = 34;
	for (; (i < _pj_a); i += 1) {
		g_p = (g_p - (((reg1_n1[i] * reg1_I1[i]) * Math.pow((7.1 - p), (reg1_I1[i] - 1))) * Math.pow((tau - 1.222), reg1_J1[i])));
		g_pp = (g_pp + ((((reg1_n1[i] * reg1_I1[i]) * (reg1_I1[i] - 1)) * Math.pow((7.1 - p), (reg1_I1[i] - 2))) * Math.pow((tau - 1.222), reg1_J1[i])));
		g_pt = (g_pt - ((((reg1_n1[i] * reg1_I1[i]) * Math.pow((7.1 - p), (reg1_I1[i] - 1))) * reg1_J1[i]) * Math.pow((tau - 1.222), (reg1_J1[i] - 1))));
		G_tt = (G_tt + ((((reg1_n1[i] * Math.pow((7.1 - p), reg1_I1[i])) * reg1_J1[i]) * (reg1_J1[i] - 1)) * Math.pow((tau - 1.222), (reg1_J1[i] - 2))));
	}
	fn_return_value = Math.pow(((((1000 * R) * T) * Math.pow(g_p, 2)) / ((Math.pow((g_p - (tau * g_pt)), 2) / (Math.pow(tau, 2) * G_tt)) - g_pp)), 0.5);
	return fn_return_value;
}
function T1_ph(p, h) {
	let T, fn_return_value;
	h = (h / 2500);
	T = 0;
	let i = 0;
	const _pj_a = 20;
	for (; (i < _pj_a); i += 1) {
		T = (T + ((T1_ph_n1[i] * Math.pow(p, T1_ph_I1[i])) * Math.pow((h + 1), T1_ph_J1[i])));
	}
	fn_return_value = T;
	return fn_return_value;
}
function T1_ps(p, s) {
	let fn_return_value;
	fn_return_value = 0;
	let i = 0;
	const _pj_a = 20;
	for (; (i < _pj_a); i += 1) {
		fn_return_value += ((T1_ps_n1[i] * Math.pow(p, T1_ps_I1[i])) * Math.pow((s + 2), T1_ps_J1[i]));
	}
	return fn_return_value;
}
function p1_hs(h, s) {
	let fn_return_value, p;
	h = (h / 3400);
	s = (s / 7.6);
	p = 0;
	let i = 0;
	const _pj_a = 19;
	for (; (i < _pj_a); i += 1) {
		p = (p + ((p1_hs_n1[i] * Math.pow((h + 0.05), p1_hs_I1[i])) * Math.pow((s + 0.05), p1_hs_J1[i])));
	}
	fn_return_value = (p * 100);
	return fn_return_value;
}
function T1_prho(p, rho) {
	let High_Bound, Low_Bound, Ts, fn_return_value, iter_count, rhos;
	Low_Bound = 273.15;
	High_Bound = T4_p(p);
	iter_count = 0;
	Ts = 0;
	rhos = 0;
	while (((Math.abs((rho - rhos)) > 1e-05) && (iter_count < 1000))) {
		Ts = ((Low_Bound + High_Bound) / 2);
		rhos = (1 / v1_pT(p, Ts));
		if ((rhos < rho)) {
			High_Bound = Ts;
		} else {
			Low_Bound = Ts;
		}
		iter_count += 1;
	}
	if ((iter_count >= 1000)) {
		fn_return_value = Number.NaN;
		return fn_return_value;
	}
	fn_return_value = Ts;
	return fn_return_value;
}
function v2_pT(p, T) {
	let R, fn_return_value, g0_pi, gr_pi, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_pi = (1 / p);
	gr_pi = 0;
	let i = 0;
	const _pj_a = 43;
	for (; (i < _pj_a); i += 1) {
		gr_pi = (gr_pi + (((reg2_nr[i] * reg2_Ir[i]) * Math.pow(p, (reg2_Ir[i] - 1))) * Math.pow((tau - 0.5), reg2_Jr[i])));
	}
	fn_return_value = (((((R * T) / p) * p) * (g0_pi + gr_pi)) / 1000);
	return fn_return_value;
}
function v2_meta_pT(p, T) {
	let R, fn_return_value, g0_pi, gr_pi, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_pi = (1 / p);
	gr_pi = 0;
	let i = 0;
	const _pj_a = 13;
	for (; (i < _pj_a); i += 1) {
		gr_pi = (gr_pi + (((reg2_meta_nr[i] * reg2_meta_Ir[i]) * Math.pow(p, (reg2_meta_Ir[i] - 1))) * Math.pow((tau - 0.5), reg2_meta_Jr[i])));
	}
	fn_return_value = (((((R * T) / p) * p) * (g0_pi + gr_pi)) / 1000);
	return fn_return_value;
}
function h2_pT(p, T) {
	let R, fn_return_value, g0_tau, gr_tau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_tau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0_tau = (g0_tau + ((reg2_n0[i] * reg2_J0[i]) * Math.pow(tau, (reg2_J0[i] - 1))));
	}
	gr_tau = 0;
	for (let i = 0, _pj_a = 43; (i < _pj_a); i += 1) {
		gr_tau = (gr_tau + (((reg2_nr[i] * Math.pow(p, reg2_Ir[i])) * reg2_Jr[i]) * Math.pow((tau - 0.5), (reg2_Jr[i] - 1))));
	}
	fn_return_value = (((R * T) * tau) * (g0_tau + gr_tau));
	return fn_return_value;
}
function h2_meta_pT(p, T) {
	let R, fn_return_value, g0_tau, gr_tau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_tau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0_tau = (g0_tau + ((reg2_meta_n0[i] * reg2_meta_J0[i]) * Math.pow(tau, (reg2_meta_J0[i] - 1))));
	}
	gr_tau = 0;
	for (let i = 0, _pj_a = 13; (i < _pj_a); i += 1) {
		gr_tau = (gr_tau + (((reg2_meta_nr[i] * Math.pow(p, reg2_meta_Ir[i])) * reg2_meta_Jr[i]) * Math.pow((tau - 0.5), (reg2_meta_Jr[i] - 1))));
	}
	fn_return_value = (((R * T) * tau) * (g0_tau + gr_tau));
	return fn_return_value;
}
function u2_pT(p, T) {
	let R, fn_return_value, g0_pi, g0_tau, gr_pi, gr_tau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_pi = (1 / p);
	g0_tau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0_tau = (g0_tau + ((reg2_n0[i] * reg2_J0[i]) * Math.pow(tau, (reg2_J0[i] - 1))));
	}
	gr_pi = 0;
	gr_tau = 0;
	for (let i = 0, _pj_a = 43; (i < _pj_a); i += 1) {
		gr_pi = (gr_pi + (((reg2_nr[i] * reg2_Ir[i]) * Math.pow(p, (reg2_Ir[i] - 1))) * Math.pow((tau - 0.5), reg2_Jr[i])));
		gr_tau = (gr_tau + (((reg2_nr[i] * Math.pow(p, reg2_Ir[i])) * reg2_Jr[i]) * Math.pow((tau - 0.5), (reg2_Jr[i] - 1))));
	}
	fn_return_value = ((R * T) * ((tau * (g0_tau + gr_tau)) - (p * (g0_pi + gr_pi))));
	return fn_return_value;
}
function u2_meta_pT(p, T) {
	let R, fn_return_value, g0_pi, g0_tau, gr_pi, gr_tau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_pi = (1 / p);
	g0_tau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0_tau = (g0_tau + ((reg2_meta_n0[i] * reg2_meta_J0[i]) * Math.pow(tau, (reg2_meta_J0[i] - 1))));
	}
	gr_pi = 0;
	gr_tau = 0;
	for (let i = 0, _pj_a = 13; (i < _pj_a); i += 1) {
		gr_pi = (gr_pi + (((reg2_meta_nr[i] * reg2_meta_Ir[i]) * Math.pow(p, (reg2_meta_Ir[i] - 1))) * Math.pow((tau - 0.5), reg2_meta_Jr[i])));
		gr_tau = (gr_tau + (((reg2_meta_nr[i] * Math.pow(p, reg2_meta_Ir[i])) * reg2_meta_Jr[i]) * Math.pow((tau - 0.5), (reg2_meta_Jr[i] - 1))));
	}
	fn_return_value = ((R * T) * ((tau * (g0_tau + gr_tau)) - (p * (g0_pi + gr_pi))));
	return fn_return_value;
}
function s2_pT(p, T) {
	let R, fn_return_value, g0, g0_tau, gr, gr_tau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0 = Math.log(p);
	g0_tau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0 = (g0 + (reg2_n0[i] * Math.pow(tau, reg2_J0[i])));
		g0_tau = (g0_tau + ((reg2_n0[i] * reg2_J0[i]) * Math.pow(tau, (reg2_J0[i] - 1))));
	}
	gr = 0;
	gr_tau = 0;
	for (let i = 0, _pj_a = 43; (i < _pj_a); i += 1) {
		gr = (gr + ((reg2_nr[i] * Math.pow(p, reg2_Ir[i])) * Math.pow((tau - 0.5), reg2_Jr[i])));
		gr_tau = (gr_tau + (((reg2_nr[i] * Math.pow(p, reg2_Ir[i])) * reg2_Jr[i]) * Math.pow((tau - 0.5), (reg2_Jr[i] - 1))));
	}
	fn_return_value = (R * ((tau * (g0_tau + gr_tau)) - (g0 + gr)));
	return fn_return_value;
}
function s2_meta_pT(p, T) {
	let R, fn_return_value, g0, g0_tau, gr, gr_tau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0 = Math.log(p);
	g0_tau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0 = (g0 + (reg2_meta_n0[i] * Math.pow(tau, reg2_meta_J0[i])));
		g0_tau = (g0_tau + ((reg2_meta_n0[i] * reg2_meta_J0[i]) * Math.pow(tau, (reg2_meta_J0[i] - 1))));
	}
	gr = 0;
	gr_tau = 0;
	for (let i = 0, _pj_a = 13; (i < _pj_a); i += 1) {
		gr = (gr + ((reg2_meta_nr[i] * Math.pow(p, reg2_meta_Ir[i])) * Math.pow((tau - 0.5), reg2_meta_Jr[i])));
		gr_tau = (gr_tau + (((reg2_meta_nr[i] * Math.pow(p, reg2_meta_Ir[i])) * reg2_meta_Jr[i]) * Math.pow((tau - 0.5), (reg2_meta_Jr[i] - 1))));
	}
	fn_return_value = (R * ((tau * (g0_tau + gr_tau)) - (g0 + gr)));
	return fn_return_value;
}
function Cp2_pT(p, T) {
	let R, fn_return_value, g0_tautau, gr_tautau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_tautau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0_tautau = (g0_tautau + (((reg2_n0[i] * reg2_J0[i]) * (reg2_J0[i] - 1)) * Math.pow(tau, (reg2_J0[i] - 2))));
	}
	gr_tautau = 0;
	for (let i = 0, _pj_a = 43; (i < _pj_a); i += 1) {
		gr_tautau = (gr_tautau + ((((reg2_nr[i] * Math.pow(p, reg2_Ir[i])) * reg2_Jr[i]) * (reg2_Jr[i] - 1)) * Math.pow((tau - 0.5), (reg2_Jr[i] - 2))));
	}
	fn_return_value = (((- R) * Math.pow(tau, 2)) * (g0_tautau + gr_tautau));
	return fn_return_value;
}
function Cp2_meta_pT(p, T) {
	let R, fn_return_value, g0_tautau, gr_tautau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_tautau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0_tautau = (g0_tautau + (((reg2_meta_n0[i] * reg2_meta_J0[i]) * (reg2_meta_J0[i] - 1)) * Math.pow(tau, (reg2_meta_J0[i] - 2))));
	}
	gr_tautau = 0;
	for (let i = 0, _pj_a = 13; (i < _pj_a); i += 1) {
		gr_tautau = (gr_tautau + ((((reg2_meta_nr[i] * Math.pow(p, reg2_meta_Ir[i])) * reg2_meta_Jr[i]) * (reg2_meta_Jr[i] - 1)) * Math.pow((tau - 0.5), (reg2_meta_Jr[i] - 2))));
	}
	fn_return_value = (((- R) * Math.pow(tau, 2)) * (g0_tautau + gr_tautau));
	return fn_return_value;
}
function Cv2_pT(p, T) {
	let R, fn_return_value, g0_tautau, gr_pi, gr_pipi, gr_pitau, gr_tautau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_tautau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0_tautau = (g0_tautau + (((reg2_n0[i] * reg2_J0[i]) * (reg2_J0[i] - 1)) * Math.pow(tau, (reg2_J0[i] - 2))));
	}
	gr_pi = 0;
	gr_pitau = 0;
	gr_pipi = 0;
	gr_tautau = 0;
	for (let i = 0, _pj_a = 43; (i < _pj_a); i += 1) {
		gr_pi = (gr_pi + (((reg2_nr[i] * reg2_Ir[i]) * Math.pow(p, (reg2_Ir[i] - 1))) * Math.pow((tau - 0.5), reg2_Jr[i])));
		gr_pipi = (gr_pipi + ((((reg2_nr[i] * reg2_Ir[i]) * (reg2_Ir[i] - 1)) * Math.pow(p, (reg2_Ir[i] - 2))) * Math.pow((tau - 0.5), reg2_Jr[i])));
		gr_pitau = (gr_pitau + ((((reg2_nr[i] * reg2_Ir[i]) * Math.pow(p, (reg2_Ir[i] - 1))) * reg2_Jr[i]) * Math.pow((tau - 0.5), (reg2_Jr[i] - 1))));
		gr_tautau = (gr_tautau + ((((reg2_nr[i] * Math.pow(p, reg2_Ir[i])) * reg2_Jr[i]) * (reg2_Jr[i] - 1)) * Math.pow((tau - 0.5), (reg2_Jr[i] - 2))));
	}
	fn_return_value = (R * ((- (Math.pow(tau, 2) * (g0_tautau + gr_tautau))) - (Math.pow(((1 + (p * gr_pi)) - ((tau * p) * gr_pitau)), 2) / (1 - (Math.pow(p, 2) * gr_pipi)))));
	return fn_return_value;
}
function Cv2_meta_pT(p, T) {
	let R, fn_return_value, g0_tautau, gr_pi, gr_pipi, gr_pitau, gr_tautau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_tautau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0_tautau = (g0_tautau + (((reg2_meta_n0[i] * reg2_meta_J0[i]) * (reg2_meta_J0[i] - 1)) * Math.pow(tau, (reg2_meta_J0[i] - 2))));
	}
	gr_pi = 0;
	gr_pitau = 0;
	gr_pipi = 0;
	gr_tautau = 0;
	for (let i = 0, _pj_a = 13; (i < _pj_a); i += 1) {
		gr_pi = (gr_pi + (((reg2_meta_nr[i] * reg2_meta_Ir[i]) * Math.pow(p, (reg2_meta_Ir[i] - 1))) * Math.pow((tau - 0.5), reg2_meta_Jr[i])));
		gr_pipi = (gr_pipi + ((((reg2_meta_nr[i] * reg2_meta_Ir[i]) * (reg2_meta_Ir[i] - 1)) * Math.pow(p, (reg2_meta_Ir[i] - 2))) * Math.pow((tau - 0.5), reg2_meta_Jr[i])));
		gr_pitau = (gr_pitau + ((((reg2_meta_nr[i] * reg2_meta_Ir[i]) * Math.pow(p, (reg2_meta_Ir[i] - 1))) * reg2_meta_Jr[i]) * Math.pow((tau - 0.5), (reg2_meta_Jr[i] - 1))));
		gr_tautau = (gr_tautau + ((((reg2_meta_nr[i] * Math.pow(p, reg2_meta_Ir[i])) * reg2_meta_Jr[i]) * (reg2_meta_Jr[i] - 1)) * Math.pow((tau - 0.5), (reg2_meta_Jr[i] - 2))));
	}
	fn_return_value = (R * ((- (Math.pow(tau, 2) * (g0_tautau + gr_tautau))) - (Math.pow(((1 + (p * gr_pi)) - ((tau * p) * gr_pitau)), 2) / (1 - (Math.pow(p, 2) * gr_pipi)))));
	return fn_return_value;
}
function w2_pT(p, T) {
	let R, fn_return_value, g0_tautau, gr_pi, gr_pipi, gr_pitau, gr_tautau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_tautau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0_tautau = (g0_tautau + (((reg2_n0[i] * reg2_J0[i]) * (reg2_J0[i] - 1)) * Math.pow(tau, (reg2_J0[i] - 2))));
	}
	gr_pi = 0;
	gr_pitau = 0;
	gr_pipi = 0;
	gr_tautau = 0;
	for (let i = 0, _pj_a = 43; (i < _pj_a); i += 1) {
		gr_pi = (gr_pi + (((reg2_nr[i] * reg2_Ir[i]) * Math.pow(p, (reg2_Ir[i] - 1))) * Math.pow((tau - 0.5), reg2_Jr[i])));
		gr_pipi = (gr_pipi + ((((reg2_nr[i] * reg2_Ir[i]) * (reg2_Ir[i] - 1)) * Math.pow(p, (reg2_Ir[i] - 2))) * Math.pow((tau - 0.5), reg2_Jr[i])));
		gr_pitau = (gr_pitau + ((((reg2_nr[i] * reg2_Ir[i]) * Math.pow(p, (reg2_Ir[i] - 1))) * reg2_Jr[i]) * Math.pow((tau - 0.5), (reg2_Jr[i] - 1))));
		gr_tautau = (gr_tautau + ((((reg2_nr[i] * Math.pow(p, reg2_Ir[i])) * reg2_Jr[i]) * (reg2_Jr[i] - 1)) * Math.pow((tau - 0.5), (reg2_Jr[i] - 2))));
	}
	fn_return_value = Math.pow(((((1000 * R) * T) * ((1 + ((2 * p) * gr_pi)) + (Math.pow(p, 2) * Math.pow(gr_pi, 2)))) / ((1 - (Math.pow(p, 2) * gr_pipi)) + (Math.pow(((1 + (p * gr_pi)) - ((tau * p) * gr_pitau)), 2) / (Math.pow(tau, 2) * (g0_tautau + gr_tautau))))), 0.5);
	return fn_return_value;
}
function w2_meta_pT(p, T) {
	let R, fn_return_value, g0_tautau, gr_pi, gr_pipi, gr_pitau, gr_tautau, tau;
	R = 0.461526;
	tau = (540 / T);
	g0_tautau = 0;
	for (let i = 0, _pj_a = 9; (i < _pj_a); i += 1) {
		g0_tautau = (g0_tautau + (((reg2_meta_n0[i] * reg2_meta_J0[i]) * (reg2_meta_J0[i] - 1)) * Math.pow(tau, (reg2_meta_J0[i] - 2))));
	}
	gr_pi = 0;
	gr_pitau = 0;
	gr_pipi = 0;
	gr_tautau = 0;
	for (let i = 0, _pj_a = 13; (i < _pj_a); i += 1) {
		gr_pi = (gr_pi + (((reg2_meta_nr[i] * reg2_meta_Ir[i]) * Math.pow(p, (reg2_meta_Ir[i] - 1))) * Math.pow((tau - 0.5), reg2_meta_Jr[i])));
		gr_pipi = (gr_pipi + ((((reg2_meta_nr[i] * reg2_meta_Ir[i]) * (reg2_meta_Ir[i] - 1)) * Math.pow(p, (reg2_meta_Ir[i] - 2))) * Math.pow((tau - 0.5), reg2_meta_Jr[i])));
		gr_pitau = (gr_pitau + ((((reg2_meta_nr[i] * reg2_meta_Ir[i]) * Math.pow(p, (reg2_meta_Ir[i] - 1))) * reg2_meta_Jr[i]) * Math.pow((tau - 0.5), (reg2_meta_Jr[i] - 1))));
		gr_tautau = (gr_tautau + ((((reg2_meta_nr[i] * Math.pow(p, reg2_meta_Ir[i])) * reg2_meta_Jr[i]) * (reg2_meta_Jr[i] - 1)) * Math.pow((tau - 0.5), (reg2_meta_Jr[i] - 2))));
	}
	fn_return_value = Math.pow(((((1000 * R) * T) * ((1 + ((2 * p) * gr_pi)) + (Math.pow(p, 2) * Math.pow(gr_pi, 2)))) / ((1 - (Math.pow(p, 2) * gr_pipi)) + (Math.pow(((1 + (p * gr_pi)) - ((tau * p) * gr_pitau)), 2) / (Math.pow(tau, 2) * (g0_tautau + gr_tautau))))), 0.5);
	return fn_return_value;
}
function T2_ph_part1(p, h) {
	let Ts, fn_return_value, hs;
	Ts = 0;
	hs = (h / 2000);
	let i = 0;
	const _pj_a = 34;
	for (; (i < _pj_a); i += 1) {
		Ts = (Ts + ((T2_ph_part1_ni[i] * Math.pow(p, T2_ph_part1_Ii[i])) * Math.pow((hs - 2.1), T2_ph_part1_Ji[i])));
	}
	fn_return_value = Ts;
	return fn_return_value;
}
function T2_ph_part2(p, h) {
	let Ts, fn_return_value, hs;
	Ts = 0;
	hs = (h / 2000);
	let i = 0;
	const _pj_a = 38;
	for (; (i < _pj_a); i += 1) {
		Ts = (Ts + ((T2_ph_part2_ni[i] * Math.pow((p - 2), T2_ph_part2_Ii[i])) * Math.pow((hs - 2.6), T2_ph_part2_Ji[i])));
	}
	fn_return_value = Ts;
	return fn_return_value;
}
function T2_ph_part3(p, h) {
	let Ts, fn_return_value, hs;
	Ts = 0;
	hs = (h / 2000);
	let i = 0;
	const _pj_a = 23;
	for (; (i < _pj_a); i += 1) {
		Ts = (Ts + ((T2_ph_part3_ni[i] * Math.pow((p + 25), T2_ph_part3_Ii[i])) * Math.pow((hs - 1.8), T2_ph_part3_Ji[i])));
	}
	fn_return_value = Ts;
	return fn_return_value;
}
function T2_ph(p, h) {
	let select_variable_0, sub_reg;
	if ((p < 4)) {
		sub_reg = 1;
	} else {
		if ((p < ((905.84278514723 - (0.67955786399241 * h)) + (0.00012809002730136 * Math.pow(h, 2))))) {
			sub_reg = 2;
		} else {
			sub_reg = 3;
		}
	}
	select_variable_0 = sub_reg;
	if ((select_variable_0 === 1)) {
		return T2_ph_part1(p, h);
	} else {
		if ((select_variable_0 === 2)) {
			return T2_ph_part2(p, h);
		} else {
			return T2_ph_part3(p, h);
		}
	}
}
function T2_ps_part1(p, s) {
	let fn_return_value, sigma, teta;
	sigma = (s / 2);
	teta = 0;
	let i = 0;
	const _pj_a = 46;
	for (; (i < _pj_a); i += 1) {
		teta = (teta + ((T2_ps_part1_ni[i] * Math.pow(p, T2_ps_part1_Ii[i])) * Math.pow((sigma - 2), T2_ps_part1_Ji[i])));
	}
	fn_return_value = teta;
	return fn_return_value;
}
function T2_ps_part2(p, s) {
	let fn_return_value, sigma, teta;
	sigma = (s / 0.7853);
	teta = 0;
	let i = 0;
	const _pj_a = 44;
	for (; (i < _pj_a); i += 1) {
		teta = (teta + ((T2_ps_part2_ni[i] * Math.pow(p, T2_ps_part2_Ii[i])) * Math.pow((10 - sigma), T2_ps_part2_Ji[i])));
	}
	fn_return_value = teta;
	return fn_return_value;
}
function T2_ps_part3(p, s) {
	let fn_return_value, sigma, teta;
	sigma = (s / 2.9251);
	teta = 0;
	let i = 0;
	const _pj_a = 30;
	for (; (i < _pj_a); i += 1) {
		teta = (teta + ((T2_ps_part3_ni[i] * Math.pow(p, T2_ps_part3_Ii[i])) * Math.pow((2 - sigma), T2_ps_part3_Ji[i])));
	}
	fn_return_value = teta;
	return fn_return_value;
}
function T2_ps(p, s) {
	let select_variable_1, sub_reg;
	if ((p < 4)) {
		sub_reg = 1;
	} else {
		if ((s < 5.85)) {
			sub_reg = 3;
		} else {
			sub_reg = 2;
		}
	}
	select_variable_1 = sub_reg;
	if ((select_variable_1 === 1)) {
		return T2_ps_part1(p, s);
	} else {
		if ((select_variable_1 === 2)) {
			return T2_ps_part2(p, s);
		} else {
			return T2_ps_part3(p, s);
		}
	}
}
function p2_hs_part1(h, s) {
	let eta, fn_return_value, p, sigma;
	eta = (h / 4200);
	sigma = (s / 12);
	p = 0;
	let i = 0;
	const _pj_a = 29;
	for (; (i < _pj_a); i += 1) {
		p = (p + ((p2_hs_part1_ni[i] * Math.pow((eta - 0.5), p2_hs_part1_Ii[i])) * Math.pow((sigma - 1.2), p2_hs_part1_Ji[i])));
	}
	fn_return_value = (Math.pow(p, 4) * 4);
	return fn_return_value;
}
function p2_hs_part2(h, s) {
	let eta, fn_return_value, p, sigma;
	eta = (h / 4100);
	sigma = (s / 7.9);
	p = 0;
	let i = 0;
	const _pj_a = 33;
	for (; (i < _pj_a); i += 1) {
		p = (p + ((p2_hs_part2_ni[i] * Math.pow((eta - 0.6), p2_hs_part2_Ii[i])) * Math.pow((sigma - 1.01), p2_hs_part2_Ji[i])));
	}
	fn_return_value = (Math.pow(p, 4) * 100);
	return fn_return_value;
}
function p2_hs_part3(h, s) {
	let eta, fn_return_value, p, sigma;
	eta = (h / 3500);
	sigma = (s / 5.9);
	p = 0;
	let i = 0;
	const _pj_a = 31;
	for (; (i < _pj_a); i += 1) {
		p = (p + ((p2_hs_part3_ni[i] * Math.pow((eta - 0.7), p2_hs_part3_Ii[i])) * Math.pow((sigma - 1.1), p2_hs_part3_Ji[i])));
	}
	fn_return_value = (Math.pow(p, 4) * 100);
	return fn_return_value;
}
function p2_hs(h, s) {
	let select_variable_2, sub_reg;
	if ((h < ((((- 3498.98083432139) + (2575.60716905876 * s)) - (421.073558227969 * Math.pow(s, 2))) + (27.6349063799944 * Math.pow(s, 3))))) {
		sub_reg = 1;
	} else {
		if ((s < 5.85)) {
			sub_reg = 3;
		} else {
			sub_reg = 2;
		}
	}
	select_variable_2 = sub_reg;
	if ((select_variable_2 === 1)) {
		return p2_hs_part1(h, s);
	} else {
		if ((select_variable_2 === 2)) {
			return p2_hs_part2(h, s);
		} else {
			return p2_hs_part3(h, s);
		}
	}
}
function T2_prho(p, rho) {
	let High_Bound, Low_Bound, Ts, fn_return_value, iter_count, rhos;
	Ts = 0;
	if ((p < 16.5292)) {
		Low_Bound = T4_p(p);
	} else {
		Low_Bound = B23T_p(p);
	}
	High_Bound = 1073.15;
	iter_count = 0;
	rhos = 0;
	while (((Math.abs((rho - rhos)) > 1e-06) && (iter_count < 1000))) {
		Ts = ((Low_Bound + High_Bound) / 2);
		rhos = (1 / v2_pT(p, Ts));
		if ((rhos < rho)) {
			High_Bound = Ts;
		} else {
			Low_Bound = Ts;
		}
		iter_count += 1;
	}
	if ((iter_count >= 1000)) {
		return Number.NaN;
	}
	fn_return_value = Ts;
	return fn_return_value;
}
function p3_rhoT(rho, T) {
	let R, delta, fidelta, fn_return_value, rhoc, tau, tc;
	R = 0.461526;
	tc = 647.096;
	// pc = 22.064;
	rhoc = 322;
	delta = (rho / rhoc);
	tau = (tc / T);
	fidelta = 0;
	let i = 1;
	const _pj_a = 40;
	for (; (i < _pj_a); i += 1) {
		fidelta = (fidelta + (((reg3_ni[i] * reg3_Ii[i]) * Math.pow(delta, (reg3_Ii[i] - 1))) * Math.pow(tau, reg3_Ji[i])));
	}
	fidelta = (fidelta + (reg3_ni[0] / delta));
	fn_return_value = (((((rho * R) * T) * delta) * fidelta) / 1000);
	return fn_return_value;
}
function u3_rhoT(rho, T) {
	let R, delta, fitau, fn_return_value, rhoc, tau, tc;
	R = 0.461526;
	tc = 647.096;
	// pc = 22.064;
	rhoc = 322;
	delta = (rho / rhoc);
	tau = (tc / T);
	fitau = 0;
	let i = 1;
	const _pj_a = 40;
	for (; (i < _pj_a); i += 1) {
		fitau = (fitau + (((reg3_ni[i] * Math.pow(delta, reg3_Ii[i])) * reg3_Ji[i]) * Math.pow(tau, (reg3_Ji[i] - 1))));
	}
	fn_return_value = ((R * T) * (tau * fitau));
	return fn_return_value;
}
function h3_rhoT(rho, T) {
	let R, delta, fidelta, fitau, fn_return_value, rhoc, tau, tc;
	R = 0.461526;
	tc = 647.096;
	// pc = 22.064;
	rhoc = 322;
	delta = (rho / rhoc);
	tau = (tc / T);
	fidelta = 0;
	fitau = 0;
	let i = 1;
	const _pj_a = 40;
	for (; (i < _pj_a); i += 1) {
		fidelta = (fidelta + (((reg3_ni[i] * reg3_Ii[i]) * Math.pow(delta, (reg3_Ii[i] - 1))) * Math.pow(tau, reg3_Ji[i])));
		fitau = (fitau + (((reg3_ni[i] * Math.pow(delta, reg3_Ii[i])) * reg3_Ji[i]) * Math.pow(tau, (reg3_Ji[i] - 1))));
	}
	fidelta = (fidelta + (reg3_ni[0] / delta));
	fn_return_value = ((R * T) * ((tau * fitau) + (delta * fidelta)));
	return fn_return_value;
}
function s3_rhoT(rho, T) {
	let R, delta, fi, fitau, fn_return_value, rhoc, tau, tc;
	R = 0.461526;
	tc = 647.096;
	// pc = 22.064;
	rhoc = 322;
	delta = (rho / rhoc);
	tau = (tc / T);
	fi = 0;
	fitau = 0;
	let i = 1;
	const _pj_a = 40;
	for (; (i < _pj_a); i += 1) {
		fi = (fi + ((reg3_ni[i] * Math.pow(delta, reg3_Ii[i])) * Math.pow(tau, reg3_Ji[i])));
		fitau = (fitau + (((reg3_ni[i] * Math.pow(delta, reg3_Ii[i])) * reg3_Ji[i]) * Math.pow(tau, (reg3_Ji[i] - 1))));
	}
	fi = (fi + (reg3_ni[0] * Math.log(delta)));
	fn_return_value = (R * ((tau * fitau) - fi));
	return fn_return_value;
}
function Cp3_rhoT(rho, T) {
	let R, delta, fidelta, fideltadelta, fideltatau, fitautau, fn_return_value, rhoc, tau, tc;
	R = 0.461526;
	tc = 647.096;
	// pc = 22.064;
	rhoc = 322;
	delta = (rho / rhoc);
	tau = (tc / T);
	fitautau = 0;
	fidelta = 0;
	fideltatau = 0;
	fideltadelta = 0;
	let i = 1;
	const _pj_a = 40;
	for (; (i < _pj_a); i += 1) {
		fitautau = (fitautau + ((((reg3_ni[i] * Math.pow(delta, reg3_Ii[i])) * reg3_Ji[i]) * (reg3_Ji[i] - 1)) * Math.pow(tau, (reg3_Ji[i] - 2))));
		fidelta = (fidelta + (((reg3_ni[i] * reg3_Ii[i]) * Math.pow(delta, (reg3_Ii[i] - 1))) * Math.pow(tau, reg3_Ji[i])));
		fideltatau = (fideltatau + ((((reg3_ni[i] * reg3_Ii[i]) * Math.pow(delta, (reg3_Ii[i] - 1))) * reg3_Ji[i]) * Math.pow(tau, (reg3_Ji[i] - 1))));
		fideltadelta = (fideltadelta + ((((reg3_ni[i] * reg3_Ii[i]) * (reg3_Ii[i] - 1)) * Math.pow(delta, (reg3_Ii[i] - 2))) * Math.pow(tau, reg3_Ji[i])));
	}
	fidelta = (fidelta + (reg3_ni[0] / delta));
	fideltadelta = (fideltadelta - (reg3_ni[0] / Math.pow(delta, 2)));
	fn_return_value = (R * ((- (Math.pow(tau, 2) * fitautau)) + (Math.pow(((delta * fidelta) - ((delta * tau) * fideltatau)), 2) / (((2 * delta) * fidelta) + (Math.pow(delta, 2) * fideltadelta)))));
	return fn_return_value;
}
function Cv3_rhoT(rho, T) {
	let R, delta, fitautau, fn_return_value, rhoc, tau, tc;
	R = 0.461526;
	tc = 647.096;
	// pc = 22.064;
	rhoc = 322;
	delta = (rho / rhoc);
	tau = (tc / T);
	fitautau = 0;
	let i = 1;
	const _pj_a = 40;
	for (; (i < _pj_a); i += 1) {
		fitautau = (fitautau + ((((reg3_ni[i] * Math.pow(delta, reg3_Ii[i])) * reg3_Ji[i]) * (reg3_Ji[i] - 1)) * Math.pow(tau, (reg3_Ji[i] - 2))));
	}
	fn_return_value = ((- R) * ((tau * tau) * fitautau));
	return fn_return_value;
}
function w3_rhoT(rho, T) {
	let R, delta, fidelta, fideltadelta, fideltatau, fitautau, fn_return_value, rhoc, tau, tc;
	R = 0.461526;
	tc = 647.096;
	// pc = 22.064;
	rhoc = 322;
	delta = (rho / rhoc);
	tau = (tc / T);
	fitautau = 0;
	fidelta = 0;
	fideltatau = 0;
	fideltadelta = 0;
	let i = 1;
	const _pj_a = 40;
	for (; (i < _pj_a); i += 1) {
		fitautau = (fitautau + ((((reg3_ni[i] * Math.pow(delta, reg3_Ii[i])) * reg3_Ji[i]) * (reg3_Ji[i] - 1)) * Math.pow(tau, (reg3_Ji[i] - 2))));
		fidelta = (fidelta + (((reg3_ni[i] * reg3_Ii[i]) * Math.pow(delta, (reg3_Ii[i] - 1))) * Math.pow(tau, reg3_Ji[i])));
		fideltatau = (fideltatau + ((((reg3_ni[i] * reg3_Ii[i]) * Math.pow(delta, (reg3_Ii[i] - 1))) * reg3_Ji[i]) * Math.pow(tau, (reg3_Ji[i] - 1))));
		fideltadelta = (fideltadelta + ((((reg3_ni[i] * reg3_Ii[i]) * (reg3_Ii[i] - 1)) * Math.pow(delta, (reg3_Ii[i] - 2))) * Math.pow(tau, reg3_Ji[i])));
	}
	fidelta = (fidelta + (reg3_ni[0] / delta));
	fideltadelta = (fideltadelta - (reg3_ni[0] / Math.pow(delta, 2)));
	fn_return_value = Math.pow((((1000 * R) * T) * ((((2 * delta) * fidelta) + (Math.pow(delta, 2) * fideltadelta)) - (Math.pow(((delta * fidelta) - ((delta * tau) * fideltatau)), 2) / (Math.pow(tau, 2) * fitautau)))), 0.5);
	return fn_return_value;
}
function T3_ph_part1(p, h) {
	let Ts, fn_return_value, hs, ps;
	ps = (p / 100);
	hs = (h / 2300);
	Ts = 0;
	let i = 0;
	const _pj_a = 31;
	for (; (i < _pj_a); i += 1) {
		Ts = (Ts + ((T3_ph_part1_ni[i] * Math.pow((ps + 0.24), T3_ph_part1_Ii[i])) * Math.pow((hs - 0.615), T3_ph_part1_Ji[i])));
	}
	fn_return_value = (Ts * 760);
	return fn_return_value;
}
function T3_ph_part2(p, h) {
	let Ts, fn_return_value, hs, ps;
	hs = (h / 2800);
	ps = (p / 100);
	Ts = 0;
	let i = 0;
	const _pj_a = 33;
	for (; (i < _pj_a); i += 1) {
		Ts = (Ts + ((T3_ph_part2_ni[i] * Math.pow((ps + 0.298), T3_ph_part2_Ii[i])) * Math.pow((hs - 0.72), T3_ph_part2_Ji[i])));
	}
	fn_return_value = (Ts * 860);
	return fn_return_value;
}
function T3_ph(p, h) {
	let h3ab;
	// R = 0.461526;
	// tc = 647.096;
	// pc = 22.064;
	// rhoc = 322;
	h3ab = (((2014.64004206875 + (3.74696550136983 * p)) - (0.0219921901054187 * Math.pow(p, 2))) + (8.7513168600995e-05 * Math.pow(p, 3)));
	if ((h < h3ab)) {
		return T3_ph_part1(p, h);
	} else {
		return T3_ph_part2(p, h);
	}
}
function v3_ph_part1(p, h) {
	let fn_return_value, hs, ps, vs;
	ps = (p / 100);
	hs = (h / 2100);
	vs = 0;
	let i = 0;
	const _pj_a = 32;
	for (; (i < _pj_a); i += 1) {
		vs = (vs + ((v3_ph_part1_ni[i] * Math.pow((ps + 0.128), v3_ph_part1_Ii[i])) * Math.pow((hs - 0.727), v3_ph_part1_Ji[i])));
	}
	fn_return_value = (vs * 0.0028);
	return fn_return_value;
}
function v3_ph_part2(p, h) {
	let fn_return_value, hs, ps, vs;
	ps = (p / 100);
	hs = (h / 2800);
	vs = 0;
	let i = 0;
	const _pj_a = 30;
	for (; (i < _pj_a); i += 1) {
		vs = (vs + ((v3_ph_part2_ni[i] * Math.pow((ps + 0.0661), v3_ph_part2_Ii[i])) * Math.pow((hs - 0.72), v3_ph_part2_Ji[i])));
	}
	fn_return_value = (vs * 0.0088);
	return fn_return_value;
}
function v3_ph(p, h) {
	let h3ab;
	// R = 0.461526;
	// tc = 647.096;
	// pc = 22.064;
	// rhoc = 322;
	h3ab = (((2014.64004206875 + (3.74696550136983 * p)) - (0.0219921901054187 * Math.pow(p, 2))) + (8.7513168600995e-05 * Math.pow(p, 3)));
	if ((h < h3ab)) {
		return v3_ph_part1(p, h);
	} else {
		return v3_ph_part2(p, h);
	}
}
function T3_ps_part1(p, s) {
	let fn_return_value, ps, sigma, teta;
	sigma = (s / 4.4);
	ps = (p / 100);
	teta = 0;
	let i = 0;
	const _pj_a = 33;
	for (; (i < _pj_a); i += 1) {
		teta = (teta + ((T3_ps_part1_ni[i] * Math.pow((ps + 0.24), T3_ps_part1_Ii[i])) * Math.pow((sigma - 0.703), T3_ps_part1_Ji[i])));
	}
	fn_return_value = (teta * 760);
	return fn_return_value;
}
function T3_ps_part2(p, s) {
	let fn_return_value, ps, sigma, teta;
	sigma = (s / 5.3);
	ps = (p / 100);
	teta = 0;
	let i = 0;
	const _pj_a = 28;
	for (; (i < _pj_a); i += 1) {
		teta = (teta + ((T3_ps_part2_ni[i] * Math.pow((ps + 0.76), T3_ps_part2_Ii[i])) * Math.pow((sigma - 0.818), T3_ps_part2_Ji[i])));
	}
	fn_return_value = (teta * 860);
	return fn_return_value;
}
function T3_ps(p, s) {
	// let R, pc, rhoc, tc;
	// R = 0.461526;
	// tc = 647.096;
	// pc = 22.064;
	// rhoc = 322;
	if ((s <= 4.41202148223476)) {
		return T3_ps_part1(p, s);
	} else {
		return T3_ps_part2(p, s);
	}
}
function v3_ps_part1(p, s) {
	let fn_return_value, omega, ps, sigma;
	ps = (p / 100);
	sigma = (s / 4.4);
	omega = 0;
	let i = 0;
	const _pj_a = 28;
	for (; (i < _pj_a); i += 1) {
		omega = (omega + ((v3_ps_part1_ni[i] * Math.pow((ps + 0.187), v3_ps_part1_Ii[i])) * Math.pow((sigma - 0.755), v3_ps_part1_Ji[i])));
	}
	fn_return_value = (omega * 0.0028);
	return fn_return_value;
}
function v3_ps_part2(p, s) {
	let fn_return_value, omega, ps, sigma;
	ps = (p / 100);
	sigma = (s / 5.3);
	omega = 0;
	let i = 0;
	const _pj_a = 31;
	for (; (i < _pj_a); i += 1) {
		omega = (omega + ((v3_ps_part2_ni[i] * Math.pow((ps + 0.298), v3_ps_part2_Ii[i])) * Math.pow((sigma - 0.816), v3_ps_part2_Ji[i])));
	}
	fn_return_value = (omega * 0.0088);
	return fn_return_value;
}
function v3_ps(p, s) {
	// let R, pc, rhoc, tc;
	// R = 0.461526;
	// tc = 647.096;
	// pc = 22.064;
	// rhoc = 322;
	if ((s <= 4.41202148223476)) {
		return v3_ps_part1(p, s);
	} else {
		return v3_ps_part2(p, s);
	}
}
function p3_hs_part1(h, s) {
	let eta, fn_return_value, ps, sigma;
	sigma = (s / 4.4);
	eta = (h / 2300);
	ps = 0;
	let i = 0;
	const _pj_a = 33;
	for (; (i < _pj_a); i += 1) {
		ps = (ps + ((p3_hs_part1_ni[i] * Math.pow((eta - 1.01), p3_hs_part1_Ii[i])) * Math.pow((sigma - 0.75), p3_hs_part1_Ji[i])));
	}
	fn_return_value = (ps * 99);
	return fn_return_value;
}
function p3_hs_part2(h, s) {
	let eta, fn_return_value, ps, sigma;
	sigma = (s / 5.3);
	eta = (h / 2800);
	ps = 0;
	let i = 0;
	const _pj_a = 35;
	for (; (i < _pj_a); i += 1) {
		ps = (ps + ((p3_hs_part2_ni[i] * Math.pow((eta - 0.681), p3_hs_part2_Ii[i])) * Math.pow((sigma - 0.792), p3_hs_part2_Ji[i])));
	}
	fn_return_value = (16.6 / ps);
	return fn_return_value;
}
function p3_hs(h, s) {
	// let R, pc, rhoc, tc;
	// R = 0.461526;
	// tc = 647.096;
	// pc = 22.064;
	// rhoc = 322;
	if ((s < 4.41202148223476)) {
		return p3_hs_part1(h, s);
	} else {
		return p3_hs_part2(h, s);
	}
}
function h3_pT(p, T) {
	let High_Bound, Low_Bound, Ts, fn_return_value, hs, iter_count;
	Ts = 0;
	if ((p < 22.06395)) {
		Ts = T4_p(p);
		if ((T <= Ts)) {
			High_Bound = h4L_p(p);
			Low_Bound = h1_pT(p, 623.15);
		} else {
			Low_Bound = h4V_p(p);
			High_Bound = h2_pT(p, B23T_p(p));
		}
	} else {
		Low_Bound = h1_pT(p, 623.15);
		High_Bound = h2_pT(p, B23T_p(p));
	}
	hs = 0;
	Ts = (T + 1);
	iter_count = 0;
	while (((Math.abs((T - Ts)) > 1e-06) && (iter_count < 1000))) {
		hs = ((Low_Bound + High_Bound) / 2);
		Ts = T3_ph(p, hs);
		if ((Ts > T)) {
			High_Bound = hs;
		} else {
			Low_Bound = hs;
		}
		iter_count += 1;
	}
	if ((iter_count >= 1000)) {
		return Number.NaN;
	}
	fn_return_value = hs;
	return fn_return_value;
}
function T3_prho(p, rho) {
	let High_Bound, Low_Bound, Ts, fn_return_value, iter_count, ps;
	Low_Bound = 623.15;
	High_Bound = 1073.15;
	iter_count = 0;
	Ts = 0;
	ps = 0;
	while (((Math.abs((p - ps)) > 1e-08) && (iter_count < 1000))) {
		Ts = ((Low_Bound + High_Bound) / 2);
		ps = p3_rhoT(rho, Ts);
		if ((ps > p)) {
			High_Bound = Ts;
		} else {
			Low_Bound = Ts;
		}
		iter_count += 1;
	}
	if ((iter_count >= 1000)) {
		return Number.NaN;
	}
	fn_return_value = Ts;
	return fn_return_value;
}
function p4_T(T) {
	let a, b, c, fn_return_value, teta;
	teta = (T - (0.23855557567849 / (T - 650.17534844798)));
	a = ((Math.pow(teta, 2) + (1167.0521452767 * teta)) - 724213.16703206);
	b = ((((- 17.073846940092) * Math.pow(teta, 2)) + (12020.82470247 * teta)) - 3232555.0322333);
	c = (((14.91510861353 * Math.pow(teta, 2)) - (4823.2657361591 * teta)) + 405113.40542057);
	fn_return_value = Math.pow(((2 * c) / ((- b) + Math.pow((Math.pow(b, 2) - ((4 * a) * c)), 0.5))), 4);
	return fn_return_value;
}
function T4_p(p) {
	let beta, d, e, f, fn_return_value, g;
	beta = Math.pow(p, 0.25);
	e = ((Math.pow(beta, 2) - (17.073846940092 * beta)) + 14.91510861353);
	f = (((1167.0521452767 * Math.pow(beta, 2)) + (12020.82470247 * beta)) - 4823.2657361591);
	g = ((((- 724213.16703206) * Math.pow(beta, 2)) - (3232555.0322333 * beta)) + 405113.40542057);
	d = ((2 * g) / ((- f) - Math.pow((Math.pow(f, 2) - ((4 * e) * g)), 0.5)));
	fn_return_value = (((650.17534844798 + d) - Math.pow((Math.pow((650.17534844798 + d), 2) - (4 * ((- 0.23855557567849) + (650.17534844798 * d)))), 0.5)) / 2);
	return fn_return_value;
}
function h4_s_part1(s) {
	let eta, fn_return_value, sigma;
	sigma = (s / 3.8);
	eta = 0;
	let i = 0;
	const _pj_a = 27;
	for (; (i < _pj_a); i += 1) {
		eta = (eta + ((h4_s_part1_ni[i] * Math.pow((sigma - 1.09), h4_s_part1_Ii[i])) * Math.pow((sigma + 3.66e-05), h4_s_part1_Ji[i])));
	}
	fn_return_value = (eta * 1700);
	return fn_return_value;
}
function h4_s_part2(s) {
	let eta, fn_return_value, sigma;
	sigma = (s / 3.8);
	eta = 0;
	let i = 0;
	const _pj_a = 19;
	for (; (i < _pj_a); i += 1) {
		eta = (eta + ((h4_s_part2_ni[i] * Math.pow((sigma - 1.09), h4_s_part2_Ii[i])) * Math.pow((sigma + 3.66e-05), h4_s_part2_Ji[i])));
	}
	fn_return_value = (eta * 1700);
	return fn_return_value;
}
function h4_s_part3(s) {
	let eta, fn_return_value, sigma;
	sigma = (s / 5.9);
	eta = 0;
	let i = 0;
	const _pj_a = 16;
	for (; (i < _pj_a); i += 1) {
		eta = (eta + ((h4_s_part3_ni[i] * Math.pow((sigma - 1.02), h4_s_part3_Ii[i])) * Math.pow((sigma - 0.726), h4_s_part3_Ji[i])));
	}
	fn_return_value = (Math.pow(eta, 4) * 2800);
	return fn_return_value;
}
function h4_s_part4(s) {
	let eta, fn_return_value, sigma1, sigma2;
	sigma1 = (s / 5.21);
	sigma2 = (s / 9.2);
	eta = 0;
	let i = 0;
	const _pj_a = 30;
	for (; (i < _pj_a); i += 1) {
		eta = (eta + ((h4_s_part4_ni[i] * Math.pow(((1 / sigma1) - 0.513), h4_s_part4_Ii[i])) * Math.pow((sigma2 - 0.524), h4_s_part4_Ji[i])));
	}
	fn_return_value = (Math.exp(eta) * 2800);
	return fn_return_value;
}
function h4_s(s) {
	let fn_return_value;
	if ((((- 0.0001545495919) < s) && (s <= 3.77828134))) {
		return h4_s_part1(s);
	} else {
		if (((3.77828134 < s) && (s <= 4.41202148223476))) {
			return h4_s_part2(s);
		} else {
			if (((4.41202148223476 < s) && (s <= 5.85))) {
				return h4_s_part3(s);
			} else {
				if (((5.85 < s) && (s < 9.155759395))) {
					return h4_s_part4(s);
				} else {
					fn_return_value = Number.NaN;
				}
			}
		}
	}
	return fn_return_value;
}
function p4_s(s) {
	let fn_return_value, hsat;
	hsat = h4_s(s);
	if ((((- 0.0001545495919) < s) && (s <= 3.77828134))) {
		fn_return_value = p1_hs(hsat, s);
	} else {
		if (((3.77828134 < s) && (s <= 5.210887663))) {
			fn_return_value = p3_hs(hsat, s);
		} else {
			if (((5.210887663 < s) && (s < 9.155759395))) {
				fn_return_value = p2_hs(hsat, s);
			} else {
				fn_return_value = Number.NaN;
			}
		}
	}
	return fn_return_value;
}
function h4L_p(p) {
	let High_Bound, Low_Bound, Ts, fn_return_value, hs, iter_count, ps;
	Ts = 0;
	ps = 0;
	if (((0.000611657 < p) && (p < 22.06395))) {
		Ts = T4_p(p);
		if ((p < 16.529)) {
			fn_return_value = h1_pT(p, Ts);
		} else {
			Low_Bound = 1670.858218;
			High_Bound = 2087.23500164864;
			iter_count = 0;
			hs = 0;
			while (((Math.abs((p - ps)) > 1e-05) && (iter_count < 1000))) {
				hs = ((Low_Bound + High_Bound) / 2);
				ps = p3sat_h(hs);
				if ((ps > p)) {
					High_Bound = hs;
				} else {
					Low_Bound = hs;
				}
				iter_count += 1;
			}
			if ((iter_count >= 1000)) {
				return Number.NaN;
			}
			fn_return_value = hs;
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function h4V_p(p) {
	let High_Bound, Low_Bound, Ts, fn_return_value, hs, iter_count, ps;
	if (((0.000611657 < p) && (p < 22.06395))) {
		Ts = T4_p(p);
		if ((p < 16.529)) {
			fn_return_value = h2_pT(p, Ts);
		} else {
			Low_Bound = 2087.23500164864;
			High_Bound = (2563.592004 + 5);
			ps = 0;
			iter_count = 0;
			hs = 0;
			while (((Math.abs((p - ps)) > 1e-06) && (iter_count < 1000))) {
				hs = ((Low_Bound + High_Bound) / 2);
				ps = p3sat_h(hs);
				if ((ps < p)) {
					High_Bound = hs;
				} else {
					Low_Bound = hs;
				}
				iter_count += 1;
			}
			if ((iter_count >= 1000)) {
				return Number.NaN;
			}
			fn_return_value = hs;
		}
	} else {
		fn_return_value = Number.NaN;
	}
	return fn_return_value;
}
function x4_ph(p, h) {
	let fn_return_value, h4l, h4v;
	h4v = h4V_p(p);
	h4l = h4L_p(p);
	if ((h > h4v)) {
		fn_return_value = 1;
	} else {
		if ((h < h4l)) {
			fn_return_value = 0;
		} else {
			fn_return_value = ((h - h4l) / (h4v - h4l));
		}
	}
	return fn_return_value;
}
function x4_ps(p, s) {
	let fn_return_value, ssL, ssV;
	if ((p < 16.529)) {
		ssV = s2_pT(p, T4_p(p));
		ssL = s1_pT(p, T4_p(p));
	} else {
		ssV = s3_rhoT((1 / v3_ph(p, h4V_p(p))), T4_p(p));
		ssL = s3_rhoT((1 / v3_ph(p, h4L_p(p))), T4_p(p));
	}
	if ((s < ssL)) {
		fn_return_value = 0;
	} else {
		if ((s > ssV)) {
			fn_return_value = 1;
		} else {
			fn_return_value = ((s - ssL) / (ssV - ssL));
		}
	}
	return fn_return_value;
}
function T4_hs(h, s) {
	let High_Bound, Low_Bound, PL, Ts, eta, fn_return_value, hL, iter_count, p, s4L, s4V, sigma, ss, teta, v4L, v4V, xs;
	if (((5.210887825 < s) && (s < 9.15546555571324))) {
		sigma = (s / 9.2);
		eta = (h / 2800);
		teta = 0;
		let i = 0;
		const _pj_a = 36;
		for (; (i < _pj_a); i += 1) {
			teta = (teta + ((T4_hs_ni[i] * Math.pow((eta - 0.119), T4_hs_Ii[i])) * Math.pow((sigma - 1.07), T4_hs_Ji[i])));
		}
		fn_return_value = (teta * 550);
	} else {
		PL = 0;
		if ((((- 0.0001545495919) < s) && (s <= 3.77828134))) {
			Low_Bound = 0.000611;
			High_Bound = 165.291642526045;
			iter_count = 0;
			hL = 0;
			while ((((Math.abs((hL - h)) > 1e-05) && (Math.abs((High_Bound - Low_Bound)) > 0.0001)) && (iter_count < 1000))) {
				PL = ((Low_Bound + High_Bound) / 2);
				Ts = T4_p(PL);
				hL = h1_pT(PL, Ts);
				if ((hL > h)) {
					High_Bound = PL;
				} else {
					Low_Bound = PL;
				}
				iter_count += 1;
			}
			if ((iter_count >= 1000)) {
				return Number.NaN;
			}
		} else {
			if (((3.77828134 < s) && (s <= 4.41202148223476))) {
				PL = p3sat_h(h);
			} else {
				if (((4.41202148223476 < s) && (s <= 5.210887663))) {
					PL = p3sat_h(h);
				}
			}
		}
		Low_Bound = 0.000611;
		High_Bound = PL;
		iter_count = 0;
		p = 0;
		ss = 0;
		while ((((Math.abs((s - ss)) > 1e-06) && (Math.abs((High_Bound - Low_Bound)) > 1e-07)) && (iter_count < 1000))) {
			p = ((Low_Bound + High_Bound) / 2);
			Ts = T4_p(p);
			xs = x4_ph(p, h);
			if ((p < 16.529)) {
				s4V = s2_pT(p, Ts);
				s4L = s1_pT(p, Ts);
			} else {
				v4V = v3_ph(p, h4V_p(p));
				s4V = s3_rhoT((1 / v4V), Ts);
				v4L = v3_ph(p, h4L_p(p));
				s4L = s3_rhoT((1 / v4L), Ts);
			}
			ss = ((xs * s4V) + ((1 - xs) * s4L));
			if ((ss < s)) {
				High_Bound = p;
			} else {
				Low_Bound = p;
			}
			iter_count += 1;
		}
		if ((iter_count >= 1000)) {
			return Number.NaN;
		}
		fn_return_value = T4_p(p);
	}
	return fn_return_value;
}
function h5_pT(p, T) {
	let R, fn_return_value, gamma0_tau, gammar_tau, tau;
	R = 0.461526;
	tau = (1000 / T);
	gamma0_tau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gamma0_tau = (gamma0_tau + ((reg5_ni0[i] * reg5_Ji0[i]) * Math.pow(tau, (reg5_Ji0[i] - 1))));
	}
	gammar_tau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gammar_tau = (gammar_tau + (((reg5_nir[i] * Math.pow(p, reg5_Iir[i])) * reg5_Jir[i]) * Math.pow(tau, (reg5_Jir[i] - 1))));
	}
	fn_return_value = (((R * T) * tau) * (gamma0_tau + gammar_tau));
	return fn_return_value;
}
function v5_pT(p, T) {
	let R, fn_return_value, gamma0_pi, gammar_pi, tau;
	R = 0.461526;
	tau = (1000 / T);
	gamma0_pi = (1 / p);
	gammar_pi = 0;
	let i = 0;
	const _pj_a = 6;
	for (; (i < _pj_a); i += 1) {
		gammar_pi = (gammar_pi + (((reg5_nir[i] * reg5_Iir[i]) * Math.pow(p, (reg5_Iir[i] - 1))) * Math.pow(tau, reg5_Jir[i])));
	}
	fn_return_value = (((((R * T) / p) * p) * (gamma0_pi + gammar_pi)) / 1000);
	return fn_return_value;
}
function u5_pT(p, T) {
	let R, fn_return_value, gamma0_pi, gamma0_tau, gammar_pi, gammar_tau, tau;
	R = 0.461526;
	tau = (1000 / T);
	gamma0_pi = (1 / p);
	gamma0_tau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gamma0_tau = (gamma0_tau + ((reg5_ni0[i] * reg5_Ji0[i]) * Math.pow(tau, (reg5_Ji0[i] - 1))));
	}
	gammar_pi = 0;
	gammar_tau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gammar_pi = (gammar_pi + (((reg5_nir[i] * reg5_Iir[i]) * Math.pow(p, (reg5_Iir[i] - 1))) * Math.pow(tau, reg5_Jir[i])));
		gammar_tau = (gammar_tau + (((reg5_nir[i] * Math.pow(p, reg5_Iir[i])) * reg5_Jir[i]) * Math.pow(tau, (reg5_Jir[i] - 1))));
	}
	fn_return_value = ((R * T) * ((tau * (gamma0_tau + gammar_tau)) - (p * (gamma0_pi + gammar_pi))));
	return fn_return_value;
}
function Cp5_pT(p, T) {
	let R, fn_return_value, gamma0_tautau, gammar_tautau, tau;
	R = 0.461526;
	tau = (1000 / T);
	gamma0_tautau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gamma0_tautau = (gamma0_tautau + (((reg5_ni0[i] * reg5_Ji0[i]) * (reg5_Ji0[i] - 1)) * Math.pow(tau, (reg5_Ji0[i] - 2))));
	}
	gammar_tautau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gammar_tautau = (gammar_tautau + ((((reg5_nir[i] * Math.pow(p, reg5_Iir[i])) * reg5_Jir[i]) * (reg5_Jir[i] - 1)) * Math.pow(tau, (reg5_Jir[i] - 2))));
	}
	fn_return_value = (((- R) * Math.pow(tau, 2)) * (gamma0_tautau + gammar_tautau));
	return fn_return_value;
}
function s5_pT(p, T) {
	let R, fn_return_value, gamma0, gamma0_tau, gammar, gammar_tau, tau;
	R = 0.461526;
	tau = (1000 / T);
	gamma0 = Math.log(p);
	gamma0_tau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gamma0_tau = (gamma0_tau + ((reg5_ni0[i] * reg5_Ji0[i]) * Math.pow(tau, (reg5_Ji0[i] - 1))));
		gamma0 = (gamma0 + (reg5_ni0[i] * Math.pow(tau, reg5_Ji0[i])));
	}
	gammar = 0;
	gammar_tau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gammar = (gammar + ((reg5_nir[i] * Math.pow(p, reg5_Iir[i])) * Math.pow(tau, reg5_Jir[i])));
		gammar_tau = (gammar_tau + (((reg5_nir[i] * Math.pow(p, reg5_Iir[i])) * reg5_Jir[i]) * Math.pow(tau, (reg5_Jir[i] - 1))));
	}
	fn_return_value = (R * ((tau * (gamma0_tau + gammar_tau)) - (gamma0 + gammar)));
	return fn_return_value;
}
function Cv5_pT(p, T) {
	let R, fn_return_value, gamma0_tautau, gammar_pi, gammar_pipi, gammar_pitau, gammar_tautau, tau;
	R = 0.461526;
	tau = (1000 / T);
	gamma0_tautau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gamma0_tautau = (gamma0_tautau + (((reg5_ni0[i] * (reg5_Ji0[i] - 1)) * reg5_Ji0[i]) * Math.pow(tau, (reg5_Ji0[i] - 2))));
	}
	gammar_pi = 0;
	gammar_pitau = 0;
	gammar_pipi = 0;
	gammar_tautau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gammar_pi = (gammar_pi + (((reg5_nir[i] * reg5_Iir[i]) * Math.pow(p, (reg5_Iir[i] - 1))) * Math.pow(tau, reg5_Jir[i])));
		gammar_pitau = (gammar_pitau + ((((reg5_nir[i] * reg5_Iir[i]) * Math.pow(p, (reg5_Iir[i] - 1))) * reg5_Jir[i]) * Math.pow(tau, (reg5_Jir[i] - 1))));
		gammar_pipi = (gammar_pipi + ((((reg5_nir[i] * reg5_Iir[i]) * (reg5_Iir[i] - 1)) * Math.pow(p, (reg5_Iir[i] - 2))) * Math.pow(tau, reg5_Jir[i])));
		gammar_tautau = (gammar_tautau + ((((reg5_nir[i] * Math.pow(p, reg5_Iir[i])) * reg5_Jir[i]) * (reg5_Jir[i] - 1)) * Math.pow(tau, (reg5_Jir[i] - 2))));
	}
	fn_return_value = (R * ((- (Math.pow(tau, 2) * (gamma0_tautau + gammar_tautau))) - (Math.pow(((1 + (p * gammar_pi)) - ((tau * p) * gammar_pitau)), 2) / (1 - (Math.pow(p, 2) * gammar_pipi)))));
	return fn_return_value;
}
function w5_pT(p, T) {
	let R, fn_return_value, gamma0_tautau, gammar_pi, gammar_pipi, gammar_pitau, gammar_tautau, tau;
	R = 0.461526;
	tau = (1000 / T);
	gamma0_tautau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gamma0_tautau = (gamma0_tautau + (((reg5_ni0[i] * (reg5_Ji0[i] - 1)) * reg5_Ji0[i]) * Math.pow(tau, (reg5_Ji0[i] - 2))));
	}
	gammar_pi = 0;
	gammar_pitau = 0;
	gammar_pipi = 0;
	gammar_tautau = 0;
	for (let i = 0, _pj_a = 6; (i < _pj_a); i += 1) {
		gammar_pi = (gammar_pi + (((reg5_nir[i] * reg5_Iir[i]) * Math.pow(p, (reg5_Iir[i] - 1))) * Math.pow(tau, reg5_Jir[i])));
		gammar_pitau = (gammar_pitau + ((((reg5_nir[i] * reg5_Iir[i]) * Math.pow(p, (reg5_Iir[i] - 1))) * reg5_Jir[i]) * Math.pow(tau, (reg5_Jir[i] - 1))));
		gammar_pipi = (gammar_pipi + ((((reg5_nir[i] * reg5_Iir[i]) * (reg5_Iir[i] - 1)) * Math.pow(p, (reg5_Iir[i] - 2))) * Math.pow(tau, reg5_Jir[i])));
		gammar_tautau = (gammar_tautau + ((((reg5_nir[i] * Math.pow(p, reg5_Iir[i])) * reg5_Jir[i]) * (reg5_Jir[i] - 1)) * Math.pow(tau, (reg5_Jir[i] - 2))));
	}
	fn_return_value = Math.pow(((((1000 * R) * T) * ((1 + ((2 * p) * gammar_pi)) + (Math.pow(p, 2) * Math.pow(gammar_pi, 2)))) / ((1 - (Math.pow(p, 2) * gammar_pipi)) + (Math.pow(((1 + (p * gammar_pi)) - ((tau * p) * gammar_pitau)), 2) / (Math.pow(tau, 2) * (gamma0_tautau + gammar_tautau))))), 0.5);
	return fn_return_value;
}
function T5_ph(p, h) {
	let High_Bound, Low_Bound, Ts, fn_return_value, hs, iter_count;
	hs = 0;
	Ts = 0;
	Low_Bound = 1073.15;
	High_Bound = 2273.15;
	iter_count = 0;
	while (((Math.abs((h - hs)) > 1e-05) && (iter_count < 1000))) {
		Ts = ((Low_Bound + High_Bound) / 2);
		hs = h5_pT(p, Ts);
		if ((hs > h)) {
			High_Bound = Ts;
		} else {
			Low_Bound = Ts;
		}
		iter_count += 1;
	}
	if ((iter_count >= 1000)) {
		return Number.NaN;
	}
	fn_return_value = Ts;
	return fn_return_value;
}
function T5_ps(p, s) {
	let High_Bound, Low_Bound, Ts, fn_return_value, iter_count, ss;
	Ts = 0;
	ss = 0;
	Low_Bound = 1073.15;
	High_Bound = 2273.15;
	iter_count = 0;
	while (((Math.abs((s - ss)) > 1e-05) && (iter_count < 1000))) {
		Ts = ((Low_Bound + High_Bound) / 2);
		ss = s5_pT(p, Ts);
		if ((ss > s)) {
			High_Bound = Ts;
		} else {
			Low_Bound = Ts;
		}
		iter_count += 1;
	}
	if ((iter_count >= 1000)) {
		return Number.NaN;
	}
	fn_return_value = Ts;
	return fn_return_value;
}
function T5_prho(p, rho) {
	let High_Bound, Low_Bound, Ts, fn_return_value, iter_count, rhos;
	Ts = 0;
	rhos = 0;
	Low_Bound = 1073.15;
	High_Bound = 2073.15;
	iter_count = 0;
	while (((Math.abs((rho - rhos)) > 1e-06) && (iter_count < 1000))) {
		Ts = ((Low_Bound + High_Bound) / 2);
		rhos = (1 / v2_pT(p, Ts));
		if ((rhos < rho)) {
			High_Bound = Ts;
		} else {
			Low_Bound = Ts;
		}
		iter_count += 1;
	}
	if ((iter_count >= 1000)) {
		return Number.NaN;
	}
	fn_return_value = Ts;
	return fn_return_value;
}
function region_pT(p, T) {
	let fn_return_value, ps;
	ps = 0;
	if ((((1073.15 < T) && (T < 2273.15)) && ((10 > p) && (p > 0.000611)))) {
		fn_return_value = 5;
	} else {
		if ((((1073.15 >= T) && (T > 273.15)) && ((100 >= p) && (p > 0.000611)))) {
			if ((T > 623.15)) {
				if ((p > B23p_T(T))) {
					fn_return_value = 3;
					if ((T < 647.096)) {
						ps = p4_T(T);
						if ((Math.abs((p - ps)) < 1e-05)) {
							fn_return_value = 4;
						}
					}
				} else {
					fn_return_value = 2;
				}
			} else {
				ps = p4_T(T);
				if ((Math.abs((p - ps)) < 1e-05)) {
					fn_return_value = 4;
				} else {
					if ((p > ps)) {
						fn_return_value = 1;
					} else {
						fn_return_value = 2;
					}
				}
			}
		} else {
			fn_return_value = 0;
		}
	}
	return fn_return_value;
}
function region_ph(p, h) {
	let Ts, fn_return_value, hL, hV, h_45, h_5u;
	if (((p < 0.000611657) || (p > 100))) {
		fn_return_value = 0;
		return fn_return_value;
	}
	if ((h < ((0.963 * p) + 2.2))) {
		if ((h < h1_pT(p, 273.15))) {
			fn_return_value = 0;
			return fn_return_value;
		}
	}
	if ((p < 16.5292)) {
		Ts = T4_p(p);
		hL = (((109.6635 * Math.log(p)) + (40.3481 * p)) + 734.58);
		if ((Math.abs((h - hL)) < 100)) {
			hL = h1_pT(p, Ts);
		}
		if ((h <= hL)) {
			fn_return_value = 1;
			return fn_return_value;
		}
		hV = (((45.1768 * Math.log(p)) - (20.158 * p)) + 2804.4);
		if ((Math.abs((h - hV)) < 50)) {
			hV = h2_pT(p, Ts);
		}
		if ((h < hV)) {
			fn_return_value = 4;
			return fn_return_value;
		}
		if ((h < 4000)) {
			fn_return_value = 2;
			return fn_return_value;
		}
		h_45 = h2_pT(p, 1073.15);
		if ((h <= h_45)) {
			fn_return_value = 2;
			return fn_return_value;
		}
		if ((p > 10)) {
			fn_return_value = 0;
			return fn_return_value;
		}
		h_5u = h5_pT(p, 2273.15);
		if ((h < h_5u)) {
			fn_return_value = 5;
			return fn_return_value;
		}
		fn_return_value = 0;
		return fn_return_value;
	} else {
		if ((h < h1_pT(p, 623.15))) {
			fn_return_value = 1;
			return fn_return_value;
		}
		if ((h < h2_pT(p, B23T_p(p)))) {
			if ((p > p3sat_h(h))) {
				fn_return_value = 3;
				return fn_return_value;
			} else {
				fn_return_value = 4;
				return fn_return_value;
			}
		}
		if ((h < h2_pT(p, 1073.15))) {
			fn_return_value = 2;
			return fn_return_value;
		}
	}
	fn_return_value = 0;
	return fn_return_value;
}
function region_ps(p, s) {
	let fn_return_value, ss;
	ss = 0;
	if (((((p < 0.000611657) || (p > 100)) || (s < 0)) || (s > s5_pT(p, 2273.15)))) {
		fn_return_value = 0;
		return fn_return_value;
	}
	if ((s > s2_pT(p, 1073.15))) {
		if ((p <= 10)) {
			fn_return_value = 5;
			return fn_return_value;
		} else {
			fn_return_value = 0;
			return fn_return_value;
		}
	}
	if ((p > 16.529)) {
		ss = s2_pT(p, B23T_p(p));
	} else {
		ss = s2_pT(p, T4_p(p));
	}
	if ((s > ss)) {
		fn_return_value = 2;
		return fn_return_value;
	}
	ss = s1_pT(p, 623.15);
	if (((p > 16.529) && (s > ss))) {
		if ((p > p3sat_s(s))) {
			fn_return_value = 3;
			return fn_return_value;
		} else {
			fn_return_value = 4;
			return fn_return_value;
		}
	}
	if (((p < 16.529) && (s > s1_pT(p, T4_p(p))))) {
		fn_return_value = 4;
		return fn_return_value;
	}
	if (((p > 0.000611657) && (s > s1_pT(p, 273.15)))) {
		fn_return_value = 1;
		return fn_return_value;
	}
	fn_return_value = 1;
	return fn_return_value;
}
function Region_hs(h, s) {
	let TMax, Tmin, fn_return_value, hB, hL, hMax, hMin, hV, vmax;
	if ((s < (- 0.0001545495919))) {
		fn_return_value = 0;
		return fn_return_value;
	}
	hMin = ((((- 0.0415878) - 2500.89262) / ((- 0.00015455) - 9.155759)) * s);
	if (((s < 9.155759395) && (h < hMin))) {
		fn_return_value = 0;
		return fn_return_value;
	}
	if ((((- 0.0001545495919) <= s) && (s <= 3.77828134))) {
		if ((h < h4_s(s))) {
			fn_return_value = 4;
			return fn_return_value;
		} else {
			if ((s < 3.397782955)) {
				TMax = T1_ps(100, s);
				hMax = h1_pT(100, TMax);
				if ((h < hMax)) {
					fn_return_value = 1;
					return fn_return_value;
				} else {
					fn_return_value = 0;
					return fn_return_value;
				}
			} else {
				hB = hB13_s(s);
				if ((h < hB)) {
					fn_return_value = 1;
					return fn_return_value;
				}
				TMax = T3_ps(100, s);
				vmax = v3_ps(100, s);
				hMax = h3_rhoT((1 / vmax), TMax);
				if ((h < hMax)) {
					fn_return_value = 3;
					return fn_return_value;
				} else {
					fn_return_value = 0;
					return fn_return_value;
				}
			}
		}
	}
	if (((5.260578707 <= s) && (s <= 11.9212156897728))) {
		if ((s > 9.155759395)) {
			Tmin = T2_ps(0.000611, s);
			hMin = h2_pT(0.000611, Tmin);
			hMax = ((((((- 0.07554022) * Math.pow(s, 4)) + (3.341571 * Math.pow(s, 3))) - (55.42151 * Math.pow(s, 2))) + (408.515 * s)) + 3031.338);
			if (((hMin < h) && (h < hMax))) {
				fn_return_value = 2;
				return fn_return_value;
			} else {
				fn_return_value = 0;
				return fn_return_value;
			}
		}
		hV = h4_s(s);
		if ((h < hV)) {
			fn_return_value = 4;
			return fn_return_value;
		}
		if ((s < 6.04048367171238)) {
			TMax = T2_ps(100, s);
			hMax = h2_pT(100, TMax);
		} else {
			hMax = ((((((- 2.988734) * Math.pow(s, 4)) + (121.4015 * Math.pow(s, 3))) - (1805.15 * Math.pow(s, 2))) + (11720.16 * s)) - 23998.33);
		}
		if ((h < hMax)) {
			fn_return_value = 2;
			return fn_return_value;
		} else {
			fn_return_value = 0;
			return fn_return_value;
		}
	}
	if (((3.77828134 <= s) && (s <= 4.41202148223476))) {
		hL = h4_s(s);
		if ((h < hL)) {
			fn_return_value = 4;
			return fn_return_value;
		}
		TMax = T3_ps(100, s);
		vmax = v3_ps(100, s);
		hMax = h3_rhoT((1 / vmax), TMax);
		if ((h < hMax)) {
			fn_return_value = 3;
			return fn_return_value;
		} else {
			fn_return_value = 0;
			return fn_return_value;
		}
	}
	if (((4.41202148223476 <= s) && (s <= 5.260578707))) {
		hV = h4_s(s);
		if ((h < hV)) {
			fn_return_value = 4;
			return fn_return_value;
		}
		if ((s <= 5.048096828)) {
			TMax = T3_ps(100, s);
			vmax = v3_ps(100, s);
			hMax = h3_rhoT((1 / vmax), TMax);
			if ((h < hMax)) {
				fn_return_value = 3;
				return fn_return_value;
			} else {
				fn_return_value = 0;
				return fn_return_value;
			}
		} else {
			if ((h > 2812.942061)) {
				if ((s > 5.09796573397125)) {
					TMax = T2_ps(100, s);
					hMax = h2_pT(100, TMax);
					if ((h < hMax)) {
						fn_return_value = 2;
						return fn_return_value;
					} else {
						fn_return_value = 0;
						return fn_return_value;
					}
				} else {
					fn_return_value = 0;
					return fn_return_value;
				}
			}
			if ((h < 2563.592004)) {
				fn_return_value = 3;
				return fn_return_value;
			}
			if ((p2_hs(h, s) > B23p_T(TB23_hs(h, s)))) {
				fn_return_value = 3;
				return fn_return_value;
			} else {
				fn_return_value = 2;
				return fn_return_value;
			}
		}
	}
	fn_return_value = Number.NaN;
	return fn_return_value;
}
function Region_prho(p, rho) {
	let fn_return_value, v;
	v = (1 / rho);
	if (((p < 0.000611657) || (p > 100))) {
		fn_return_value = 0;
		return fn_return_value;
	}
	if ((p < 16.5292)) {
		if ((v < v1_pT(p, 273.15))) {
			fn_return_value = 0;
			return fn_return_value;
		}
		if ((v <= v1_pT(p, T4_p(p)))) {
			fn_return_value = 1;
			return fn_return_value;
		}
		if ((v < v2_pT(p, T4_p(p)))) {
			fn_return_value = 4;
			return fn_return_value;
		}
		if ((v <= v2_pT(p, 1073.15))) {
			fn_return_value = 2;
			return fn_return_value;
		}
		if ((p > 10)) {
			fn_return_value = 0;
			return fn_return_value;
		}
		if ((v <= v5_pT(p, 2073.15))) {
			fn_return_value = 5;
			return fn_return_value;
		}
	} else {
		if ((v < v1_pT(p, 273.15))) {
			fn_return_value = 0;
			return fn_return_value;
		}
		if ((v < v1_pT(p, 623.15))) {
			fn_return_value = 1;
			return fn_return_value;
		}
		if ((v < v2_pT(p, B23T_p(p)))) {
			if ((p > 22.064)) {
				fn_return_value = 3;
				return fn_return_value;
			}
			if (((v < v3_ph(p, h4L_p(p))) || (v > v3_ph(p, h4V_p(p))))) {
				fn_return_value = 3;
				return fn_return_value;
			} else {
				fn_return_value = 4;
				return fn_return_value;
			}
		}
		if ((v < v2_pT(p, 1073.15))) {
			fn_return_value = 2;
			return fn_return_value;
		}
	}
	fn_return_value = 0;
	return fn_return_value;
}
function B23p_T(T) {
	let fn_return_value;
	fn_return_value = ((348.05185628969 - (1.1671859879975 * T)) + (0.0010192970039326 * Math.pow(T, 2)));
	return fn_return_value;
}
function B23T_p(p) {
	let fn_return_value;
	fn_return_value = (572.54459862746 + Math.pow(((p - 13.91883977887) / 0.0010192970039326), 0.5));
	return fn_return_value;
}
function p3sat_h(h) {
	let fn_return_value, ps;
	h = (h / 2600);
	ps = 0;
	let i = 0;
	const _pj_a = 14;
	for (; (i < _pj_a); i += 1) {
		ps = (ps + ((p3sat_h_ni[i] * Math.pow((h - 1.02), p3sat_h_Ii[i])) * Math.pow((h - 0.608), p3sat_h_Ji[i])));
	}
	fn_return_value = (ps * 22);
	return fn_return_value;
}
function p3sat_s(s) {
	let fn_return_value, p, sigma;
	sigma = (s / 5.2);
	p = 0;
	let i = 0;
	const _pj_a = 10;
	for (; (i < _pj_a); i += 1) {
		p = (p + ((p3sat_s_ni[i] * Math.pow((sigma - 1.03), p3sat_s_Ii[i])) * Math.pow((sigma - 0.699), p3sat_s_Ji[i])));
	}
	fn_return_value = (p * 22);
	return fn_return_value;
}
function hB13_s(s) {
	let eta, fn_return_value, sigma;
	sigma = (s / 3.8);
	eta = 0;
	let i = 0;
	const _pj_a = 6;
	for (; (i < _pj_a); i += 1) {
		eta = (eta + ((hB13_s_ni[i] * Math.pow((sigma - 0.884), hB13_s_Ii[i])) * Math.pow((sigma - 0.864), hB13_s_Ji[i])));
	}
	fn_return_value = (eta * 1700);
	return fn_return_value;
}
function TB23_hs(h, s) {
	let eta, fn_return_value, sigma, teta;
	sigma = (s / 5.3);
	eta = (h / 3000);
	teta = 0;
	let i = 0;
	const _pj_a = 25;
	for (; (i < _pj_a); i += 1) {
		teta = (teta + ((TB23_hs_ni[i] * Math.pow((eta - 0.727), TB23_hs_Ii[i])) * Math.pow((sigma - 0.864), TB23_hs_Ji[i])));
	}
	fn_return_value = (teta * 900);
	return fn_return_value;
}
function my_AllRegions_pT(p, T) {
	let Ts, fn_return_value, my0, my1, rho, rhos, select_variable_0, sum_x;
	select_variable_0 = region_pT(p, T);
	if ((select_variable_0 === 1)) {
		rho = (1 / v1_pT(p, T));
	} else {
		if ((select_variable_0 === 2)) {
			rho = (1 / v2_pT(p, T));
		} else {
			if ((select_variable_0 === 3)) {
				rho = (1 / v3_ph(p, h3_pT(p, T)));
			} else {
				if ((select_variable_0 === 4)) {
					rho = Number.NaN;
				} else {
					if ((select_variable_0 === 5)) {
						rho = (1 / v5_pT(p, T));
					} else {
						fn_return_value = Number.NaN;
						return fn_return_value;
					}
				}
			}
		}
	}
	rhos = (rho / 317.763);
	Ts = (T / 647.226);
	// ps = (p / 22.115);
	if (((((T > (900 + 273.15)) || ((T > (600 + 273.15)) && (p > 300))) || ((T > (150 + 273.15)) && (p > 350))) || (p > 500))) {
		fn_return_value = Number.NaN;
		return fn_return_value;
	}
	my0 = (Math.pow(Ts, 0.5) / (((1 + (0.978197 / Ts)) + (0.579829 / Math.pow(Ts, 2))) - (0.202354 / Math.pow(Ts, 3))));
	sum_x = 0;
	let i = 0;
	const _pj_a = 6;
	for (; (i < _pj_a); i += 1) {
		sum_x = (((((((sum_x + (my_pT_h0[i] * Math.pow(((1 / Ts) - 1), i))) + ((my_pT_h1[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 1))) + ((my_pT_h2[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 2))) + ((my_pT_h3[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 3))) + ((my_pT_h4[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 4))) + ((my_pT_h5[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 5))) + ((my_pT_h6[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 6)));
	}
	my1 = Math.exp((rhos * sum_x));
	fn_return_value = ((my0 * my1) * 5.5071e-05);
	return fn_return_value;
}
function my_AllRegions_ph(p, h) {
	let T, Ts, fn_return_value, my0, my1, rho, rhos, select_variable_1, sum_x, v4L, v4V, xs;
	select_variable_1 = region_ph(p, h);
	if ((select_variable_1 === 1)) {
		Ts = T1_ph(p, h);
		T = Ts;
		rho = (1 / v1_pT(p, Ts));
	} else {
		if ((select_variable_1 === 2)) {
			Ts = T2_ph(p, h);
			T = Ts;
			rho = (1 / v2_pT(p, Ts));
		} else {
			if ((select_variable_1 === 3)) {
				rho = (1 / v3_ph(p, h));
				T = T3_ph(p, h);
			} else {
				if ((select_variable_1 === 4)) {
					xs = x4_ph(p, h);
					if ((p < 16.529)) {
						v4V = v2_pT(p, T4_p(p));
						v4L = v1_pT(p, T4_p(p));
					} else {
						v4V = v3_ph(p, h4V_p(p));
						v4L = v3_ph(p, h4L_p(p));
					}
					rho = (1 / ((xs * v4V) + ((1 - xs) * v4L)));
					T = T4_p(p);
				} else {
					if ((select_variable_1 === 5)) {
						Ts = T5_ph(p, h);
						T = Ts;
						rho = (1 / v5_pT(p, Ts));
					} else {
						fn_return_value = Number.NaN;
						return fn_return_value;
					}
				}
			}
		}
	}
	rhos = (rho / 317.763);
	Ts = (T / 647.226);
	// ps = (p / 22.115);
	if (((((T > (900 + 273.15)) || ((T > (600 + 273.15)) && (p > 300))) || ((T > (150 + 273.15)) && (p > 350))) || (p > 500))) {
		fn_return_value = Number.NaN;
		return fn_return_value;
	}
	my0 = (Math.pow(Ts, 0.5) / (((1 + (0.978197 / Ts)) + (0.579829 / Math.pow(Ts, 2))) - (0.202354 / Math.pow(Ts, 3))));
	sum_x = 0;
	let i = 0;
	const _pj_a = 6;
	for (; (i < _pj_a); i += 1) {
		sum_x = (((((((sum_x + (my_ph_h0[i] * Math.pow(((1 / Ts) - 1), i))) + ((my_ph_h1[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 1))) + ((my_ph_h2[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 2))) + ((my_ph_h3[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 3))) + ((my_ph_h4[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 4))) + ((my_ph_h5[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 5))) + ((my_ph_h6[i] * Math.pow(((1 / Ts) - 1), i)) * Math.pow((rhos - 1), 6)));
	}
	my1 = Math.exp((rhos * sum_x));
	fn_return_value = ((my0 * my1) * 5.5071e-05);
	return fn_return_value;
}
function tc_ptrho(p, T, rho) {
	let Q, dT, fn_return_value, s, tc0, tc1, tc2;
	if ((T < 273.15)) {
		fn_return_value = Number.NaN;
		return fn_return_value;
	} else {
		if ((T < (500 + 273.15))) {
			if ((p > 100)) {
				fn_return_value = Number.NaN;
				return fn_return_value;
			}
		} else {
			if ((T <= (650 + 273.15))) {
				if ((p > 70)) {
					fn_return_value = Number.NaN;
					return fn_return_value;
				}
			} else {
				if ((T <= (800 + 273.15))) {
					if ((p > 40)) {
						fn_return_value = Number.NaN;
						return fn_return_value;
					}
				}
			}
		}
	}
	T = (T / 647.26);
	rho = (rho / 317.7);
	tc0 = (Math.pow(T, 0.5) * (((0.0102811 + (0.0299621 * T)) + (0.0156146 * Math.pow(T, 2))) - (0.00422464 * Math.pow(T, 3))));
	tc1 = (((- 0.39707) + (0.400302 * rho)) + (1.06 * Math.exp(((- 0.171587) * Math.pow((rho + 2.39219), 2)))));
	dT = (Math.abs((T - 1)) + 0.00308976);
	Q = (2 + (0.0822994 / Math.pow(dT, (3 / 5))));
	if ((T >= 1)) {
		s = (1 / dT);
	} else {
		s = (10.0932 / Math.pow(dT, (3 / 5)));
	}
	tc2 = ((((((0.0701309 / Math.pow(T, 10)) + 0.011852) * Math.pow(rho, (9 / 5))) * Math.exp((0.642857 * (1 - Math.pow(rho, (14 / 5)))))) + (((0.00169937 * s) * Math.pow(rho, Q)) * Math.exp(((Q / (1 + Q)) * (1 - Math.pow(rho, (1 + Q))))))) - (1.02 * Math.exp((((- 4.11717) * Math.pow(T, (3 / 2))) - (6.17937 / Math.pow(rho, 5))))));
	fn_return_value = ((tc0 + tc1) + tc2);
	return fn_return_value;
}
function Surface_Tension_T(T) {
	let b, bb, fn_return_value, my, tau, tc;
	tc = 647.096;
	b = 0.2358;
	bb = (- 0.625);
	my = 1.256;
	if (((T < 0.01) || (T > tc))) {
		fn_return_value = Number.NaN;
		return fn_return_value;
	}
	tau = (1 - (T / tc));
	fn_return_value = ((b * Math.pow(tau, my)) * (1 + (bb * tau)));
	return fn_return_value;
}

function pT(p, T) {
	p += 101325; p /= 1e6;
	let fn_return_value = {};
	fn_return_value.p = p * 1e6 - 101325;
	fn_return_value.T = T;
	fn_return_value.h = h_pT(p, T);
	fn_return_value.v = v_pT(p, T);
	fn_return_value.rho = rho_pT(p, T);
	fn_return_value.s = s_pT(p, T);
	fn_return_value.u = u_pT(p, T);
	fn_return_value.Cp = Cp_pT(p, T);
	fn_return_value.Cv = Cv_pT(p, T);
	fn_return_value.w = w_pT(p, T);
	fn_return_value.my = my_pT(p, T);
	fn_return_value.tc = tc_pT(p, T);
	fn_return_value.st = st_T(T);
	fn_return_value.x = x_ph(p, fn_return_value.h);
	fn_return_value.vx = vx_ph(p, fn_return_value.h);
	return fn_return_value;
}

function ph(p, h) {
	p += 101325; p /= 1e6;
	let fn_return_value = {};
	fn_return_value.p = p * 1e6 - 101325;
	fn_return_value.h = h;
	fn_return_value.T = T_ph(p, h);
	fn_return_value.v = v_ph(p, h);
	fn_return_value.rho = rho_ph(p, h);
	fn_return_value.s = s_ph(p, h);
	fn_return_value.u = u_ph(p, h);
	fn_return_value.Cp = Cp_ph(p, h);
	fn_return_value.Cv = Cv_ph(p, h);
	fn_return_value.w = w_ph(p, h);
	fn_return_value.my = my_ph(p, h);
	fn_return_value.tc = tc_ph(p, h);
	fn_return_value.st = st_T(fn_return_value.T);
	fn_return_value.x = x_ph(p, fn_return_value.h);
	fn_return_value.vx = vx_ph(p, fn_return_value.h);
	return fn_return_value
}

function ps(p, s) {
	p += 101325; p /= 1e6;
	let fn_return_value = {}
	fn_return_value.p = p * 1e6 - 101325;
	fn_return_value.s = s
	fn_return_value.T = T_ps(p, s)
	fn_return_value.h = h_ps(p, s)
	fn_return_value.v = v_ps(p, s)
	fn_return_value.rho = rho_ps(p, s)
	fn_return_value.u = u_ps(p, s)
	fn_return_value.Cp = Cp_ps(p, s)
	fn_return_value.Cv = Cv_ps(p, s)
	fn_return_value.w = w_ps(p, s)
	fn_return_value.my = my_ps(p, s)
	fn_return_value.tc = tc_ph(p, fn_return_value.h)
	fn_return_value.st = st_T(fn_return_value.T)
	fn_return_value.x = x_ps(p, s)
	fn_return_value.vx = vx_ps(p, s)
	return fn_return_value
}

function prho(p, rho) {
	p += 101325; p /= 1e6;
	let fn_return_value = {}
	fn_return_value.p = p * 1e6 - 101325;
	fn_return_value.rho = rho
	fn_return_value.h = h_prho(p, rho)
	fn_return_value.T = T_ph(p, fn_return_value.h)
	fn_return_value.v = v_ph(p, fn_return_value.h)
	fn_return_value.s = s_ph(p, fn_return_value.h)
	fn_return_value.u = u_ph(p, fn_return_value.h)
	fn_return_value.Cp = Cp_ph(p, fn_return_value.h)
	fn_return_value.Cv = Cv_ph(p, fn_return_value.h)
	fn_return_value.w = w_ph(p, fn_return_value.h)
	fn_return_value.my = my_ph(p, fn_return_value.h)
	fn_return_value.tc = tc_ph(p, fn_return_value.h)
	fn_return_value.st = st_T(fn_return_value.T)
	fn_return_value.x = x_ph(p, fn_return_value.h)
	fn_return_value.vx = vx_ph(p, fn_return_value.h)
	return fn_return_value
}

function px(p, x) {
	p += 101325; p /= 1e6;
	let fn_return_value = {}
	fn_return_value.p = p * 1e6 - 101325;
	fn_return_value.x = x
	fn_return_value.T = Tsat_p(p);
	fn_return_value.h = h_px(p, x); 
	fn_return_value.v = v_ph(p, fn_return_value.h)
	fn_return_value.rho = rho_ph(p, fn_return_value.h)
	fn_return_value.s = s_ph(p, fn_return_value.h)
	fn_return_value.u = u_ph(p, fn_return_value.h)
	fn_return_value.Cp = Cp_ph(p, fn_return_value.h)
	fn_return_value.Cv = Cv_ph(p, fn_return_value.h)
	fn_return_value.w = w_ph(p, fn_return_value.h)
	fn_return_value.my = my_ph(p, fn_return_value.h)
	fn_return_value.tc = tc_ph(p, fn_return_value.h)
	fn_return_value.st = st_T(fn_return_value.T)
	fn_return_value.vx = vx_ph(p, fn_return_value.h)
	return fn_return_value
}

function Tx(T, x) {
	let fn_return_value = {}
	fn_return_value.T = T
	fn_return_value.x = x
	let p = psat_T(T)
	fn_return_value.h = h_Tx(T, x)
	fn_return_value.v = v_ph(p, fn_return_value.h)
	fn_return_value.rho = rho_ph(p, fn_return_value.h)
	fn_return_value.s = s_ph(p, fn_return_value.h)
	fn_return_value.u = u_ph(p, fn_return_value.h)
	fn_return_value.Cp = Cp_ph(p, fn_return_value.h)
	fn_return_value.Cv = Cv_ph(p, fn_return_value.h)
	fn_return_value.w = w_ph(p, fn_return_value.h)
	fn_return_value.my = my_ph(p, fn_return_value.h)
	fn_return_value.tc = tc_ph(p, fn_return_value.h)
	fn_return_value.st = st_T(fn_return_value.T)
	fn_return_value.vx = vx_ph(p, fn_return_value.h)
	fn_return_value.p = p * 1e6;
	return fn_return_value
}

function hs(h, s) {
	let fn_return_value = {}
	fn_return_value.h = h
	fn_return_value.s = s
	fn_return_value.T = T_hs(h, s)
	let p = p_hs(h, s)
	fn_return_value.v = v_ph(p, fn_return_value.h)
	fn_return_value.rho = rho_ph(p, fn_return_value.h)
	fn_return_value.u = u_ph(p, fn_return_value.h)
	fn_return_value.Cp = Cp_ph(p, fn_return_value.h)
	fn_return_value.Cv = Cv_ph(p, fn_return_value.h)
	fn_return_value.w = w_ph(p, fn_return_value.h)
	fn_return_value.my = my_ph(p, fn_return_value.h)
	fn_return_value.tc = tc_ph(p, fn_return_value.h)
	fn_return_value.st = st_T(fn_return_value.T)
	fn_return_value.x = x_ph(p, h)
	fn_return_value.vx = vx_ph(p, fn_return_value.h)
	fn_return_value.p = p * 1e6;
	return fn_return_value
}

function hrho(h, rho) {
	let fn_return_value = {}
	fn_return_value.h = h
	fn_return_value.rho = rho
	let p = p_hrho(h, rho)
	fn_return_value.T = T_ph(p, h)
	fn_return_value.v = v_ph(p, fn_return_value.h)
	fn_return_value.s = s_ph(p, fn_return_value.h)
	fn_return_value.u = u_ph(p, fn_return_value.h)
	fn_return_value.Cp = Cp_ph(p, fn_return_value.h)
	fn_return_value.Cv = Cv_ph(p, fn_return_value.h)
	fn_return_value.w = w_ph(p, fn_return_value.h)
	fn_return_value.my = my_ph(p, fn_return_value.h)
	fn_return_value.tc = tc_ph(p, fn_return_value.h)
	fn_return_value.st = st_T(fn_return_value.T)
	fn_return_value.x = x_ph(p, h)
	fn_return_value.vx = vx_ph(p, fn_return_value.h)
	fn_return_value.p = p * 1e6
	return fn_return_value
}

export {pT, ph, ps, prho, px, Tx, hs, hrho, T_ph, h_pT, rho_pT, x_ph, rho_ph, my_pT}